Download the PHP package lite-view/framework without Composer

On this page you can find all versions of the php package lite-view/framework. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package framework

lite-view/framework

应用实例参考

介绍

LiteView 是一个极简的 PHP MVC 框架,专注于提供清晰、可控、无黑盒的 Web 开发体验。依赖仅有 Twig(模板引擎)和 Monolog(日志),其余核心功能全部自研。

框架的初衷和意义

项目状态

项目版本遵循 语义化版本号

安装

快速开始

注意:仓库根目录的 index.php 是框架功能演示示例,展示了路由、中间件、控制器和模板渲染的用法。请勿在生产环境中直接使用它,而是参考示例编写你自己的入口文件。

创建你的项目入口文件(例如 public/index.php):

并在项目根目录创建 config.json

本地调试

php内置服务器运行模式


核心功能

1. 路由系统 (LiteView\Kernel\Route)

支持静态路由、参数路由、正则约束、可选参数和路由分组。

2. 中间件管道 (LiteView\Support\Dispatcher)

基于洋葱模型的中间件管道,支持前置处理、后置处理和响应修改。

3. 请求对象 (LiteView\Kernel\Visitor)

封装请求参数、Session 用户管理和 IP 获取。

4. 视图渲染 (LiteView\Kernel\View)

支持 Twig 模板和原生 PHP 模板。

5. 异常与错误处理

框架自动捕获异常、Error 和 Fatal Error,根据 debug 配置决定输出详细错误页或友好提示。

6. API Token (LiteView\Utils\ApiToken)

内置无状态 Token 认证,支持签名验证、过期检查和 Guard 隔离。

7. 日志系统 (LiteView\Utils\Log)

基于 Monolog 的日志通道,支持多通道、自定义 Handler 和 Processor。

8. 辅助函数


配置

在项目根目录创建 config.json,框架通过 cfg('key') 读取配置。环境配置会从 config.{app_env}.json 合并覆盖。

配置项 使用位置 说明
debug Dispatcher true 时显示详细错误信息,false 时只显示"系统繁忙"
app_env Dispatcher 环境名称,框架启动时加载 config.{app_env}.json 并合并到配置
app_url domain() 站点 URL 覆盖,默认根据 $_SERVER 自动推断
app_key ApiToken 密码哈希 (passwdMake) 的加密密钥
api_token_secret ApiToken API Token 签名密钥
location Route, Visitor URL 路径前缀,用于同一项目部署在不同目录时自动加前缀
trust_proxy Visitor::ip() 是否信任 X-Forwarded-For 头获取真实 IP
template_path View Twig 模板目录路径(相对于项目根目录),默认 resources/views/
cors cors() CORS 跨域配置,结构见下方
logging Log Monolog 日志通道配置,结构见下方

CORS 配置

日志配置

handlers 支持数组或可调用函数返回数组;processors 为 Monolog 处理器类名数组。框架内置 main 通道写 storage/logs/main.log


All versions of framework with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2 || ^8.0
monolog/monolog Version ^2.5
twig/twig Version ^3.11
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lite-view/framework contains the following files

Loading the files please wait ...