Download the PHP package phpframe-project/template without Composer

On this page you can find all versions of the php package phpframe-project/template. 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 template

PHPFrame 项目模板

基于 PHPFrame 框架的项目模板,支持 FPM / CLI(ReactPHP 常驻内存)/ Shell 三模式运行。

快速开始

目录结构

三种运行模式

FPM 模式

传统 PHP-FPM 或内置开发服务器,适合传统 Web 部署:

Nginx配置

请确保,如下面的配置所示,您的 Web 服务器将所有请求定向到您的应用程序的 public/index.php 文件。您永远不应该尝试将 index.php 文件移动到项目的根目录,因为从项目根目录提供应用程序将会将许多敏感的配置文件暴露给公共互联网

CLI 模式(ReactPHP 常驻内存)

高性能常驻内存服务器,支持多 Worker 进程:

Shell 模式

命令行任务执行,适合定时任务、数据迁移、批量处理:

核心用法

路由

在 routes/default.php 中定义 HTTP 路由:

在 routes/shell.php 中定义 Shell 路由:

控制器

HTTP 控制器继承 BaseController:

Shell 控制器继承 BaseShell:

中间件

中间件通过 Route 门面注册时采用延迟机制:先暂存到内部队列,待 RouteManager 创建后由框架自动统一应用。

门面

依赖注入

配置

配置文件放在 config/ 目录下,自动加载。支持环境覆盖:

缓存

数据库

日志

模板渲染

JSON 响应

重定向

环境变量

复制 .env.example 为 .env 并按需修改:

变量 说明 默认值
APP_NAME 应用名称 PHPFrame
APP_ENV 环境(local/production) local
APP_DEBUG 调试模式 true
DB_HOST 数据库主机 127.0.0.1
DB_DATABASE 数据库名 phpframe
CACHE_DRIVER 缓存驱动(redis/file) redis
REDIS_HOST Redis 主机 127.0.0.1

环境要求

文档

完整文档请参阅 PHPFrame 文档。

License

MIT


All versions of template with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-pdo Version *
phpframe-project/phpframe 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 phpframe-project/template contains the following files

Loading the files please wait ...