Download the PHP package larkframe/template without Composer

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

LarkFrame 项目模板

基于 LarkFrame Core 框架的项目模板,开箱即用。

环境要求

快速开始

默认监听 http://0.0.0.0:8080

首次启动时,框架会自动在项目根目录创建 .env 文件(包含 APP_NAME、TIME_ZONE、RUN_MODE),无需手动配置。

项目结构

框架文档

框架 larkframe/core 的完整组件文档随包分发(不在本模板内):

核心功能示例

路由

路由定义在 config/route.php:

控制器

数据库

缓存

Redis

队列

队列任务类:

中间件

注册中间件:

工具集

视图

配置说明

环境变量 (.env)

.env 文件仅用于定义应用启动参数,框架首次启动时会自动创建(默认 RUN_MODE=prod)。它不会注入到 config() 配置系统中。

敏感配置(数据库密码、Redis 密码等)应通过 config/config.{env}.php 环境覆盖文件管理,而非 .env。

config/config.php 中 app.debug 默认 false(生产安全)。开发时将 .env 的 RUN_MODE 改为 dev,并创建 config/config.dev.php 覆盖 ['app' => ['debug' => true]] 即可开启堆栈详情。

多环境配置

注意(浅合并):环境覆盖为顶层 array_merge——覆盖文件中的顶层键 (如 server)会整体替换主配置的对应键,必须携带完整子结构。 例如 config.dev.php 覆盖 server.socketName 时需同时带上 server.middleware, 否则全局中间件会被清空。

自定义类库配置

app/Library/Notify.php 对应 config/notify.php,配置自动加载到 $this->config:

运行模式

框架通过入口文件显式指定运行模式(App::run(LarkFrame\Consts::RUN_TYPE_*)):

模式 启动方式 入口文件
Server php server.php server.php
Shell php shell.php route "key=value" shell.php
Task php task.php <taskname> [start\|stop\|restart\|reload\|status] [args] task.php
Web 浏览器访问 public/index.php

Server 模式(推荐)

常驻内存,事件驱动,高性能,支持多 Worker 进程。

Server 模式启动后监听 config.server.socketName 指定的地址(默认 http://0.0.0.0:8080),通过 HTTP 协议接收请求,路由匹配和请求处理在 Worker 进程中完成。

配置项(config/config.php):

Shell 模式

命令行执行单次任务,路由匹配 Route::shell() 定义的路由。

Shell 模式下:

Task 模式

常驻内存 Worker 进程执行自定义任务,适合队列消费、定时任务、后台处理等场景。taskname 对应 config/task.php 中定义的任务配置。

配置项(config/task.php):

任务类需实现 run 静态方法:

运行时文件在 runtime/ 目录下:task-{name}.pid、task-{name}.log、task-{name}.stdout.log

Web 模式(PHP-FPM)

传统 PHP-FPM 部署,每次请求独立进程。站点根目录必须指向 public/,不要指向项目根目录。

访问示例:http://example.com/api

Web 模式下:

License

MIT


All versions of template with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-gd Version *
ext-pdo Version *
larkframe/core Version 0.1.0
genkgo/mail Version ^2.12
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 larkframe/template contains the following files

Loading the files please wait ...