Download the PHP package woann/light-php without Composer

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

🚀Light-php是一个基于swoole的高性能php框架,轻量的封装和易用性,使它在中小型高性能项目中有着出色的表现。

Latest Stable Version Total Downloads License Php Version Swoole Version

文档目录

环境要求

依赖 说明
PHP >= 7.2 推荐7.2
Swoole >= 4.2.9 从2.0.12开始不再支持PHP5 推荐4.2.9+
Linux 大部分的linux系统都可以 推荐centos

安装教程

1-1.通过Composer安装(packagist),此方式安装版本可能不是最新的,出现此问题请用1-2方式安装。

1-2.通过Git安装。

2.重命名.env.example文件为.env,并配置

3.项目根目录下执行 php bin\light start 启动服务

image.png

4.浏览器访问http://127.0.0.1:9521 即可看到欢迎页面。至此,框架就安装完成了。

配置文件

1.Light-php的配置文件在/config目录下,框架集成了全局环境配置文件/.env,常规配置都在.env文件中进行配置。

2./config/app.php,框架主要配置文件主要用来配置swoole扩展相关参数。

3./config/databases.php,数据库配置文件,配置了数据库连接相关参数。

4./config/hook.php,配置钩子(钩子主要用来将业务逻辑和通知服务分离)。

5./config/redis.php,redis配置文件,配置了redis连接相关参数。

6./config/route.php,路由配置文件。

7.以上配置文件具体参数意义在代码中都有注释,这里不做更多介绍

路由

以下是一个路由示例/config/route.php,包含http路由和websocket路由(注意:路由中,控制器参数为控制器的简写,实际控制器文件应在后追加Controller)

中间件

中间件文件应建立在/app/Middleware目录下,类名与文件名要一致,并实现Lib\Middleware接口,中间件处理方法名必须为handle,过滤后如果通过最终返回结果必须为true。示例:

控制器

1.创建控制器,控制器文件应建立在/app/Controller目录下,类名与文件名要一致,必须继承Lib\Controller类,示例:

2.获取参数

钩子

1.创建钩子,钩子文件应建立在/app/Hook目录下,类名与文件名要一致,必须继承Lib\BaseHook类,示例:

2.在钩子配置文件/app/config/hook.php中注册钩子

3.使用钩子

Task任务

1.创建Task类,Task文件应建立在/app/Task目录下,类名与文件名要一致,示例:

2.控制器中投递任务

WebSocket

1.开启websocket server,配置.env文件SERVER_TYPE=websocket,此配置环境下可同时监听http

2.定义路由,参考文档路由部分,在路由配置文件/config/route.phpwebsocket索引下定义路由。

3.控制器示例

4.前端略过(视图目录中有一个ws.blade.php文件,可以用来测试websocket)...

数据库

数据库采用laravel框架的Illuminate\Database,熟悉laravel的小伙伴可极速上手。

1.查询构建器,参考文档

2.Model,参考文档

压力测试

image.png

image.png


All versions of light-php with dependencies

PHP Build Version
Package Version
Requires illuminate/database Version ^5.7
illuminate/pagination Version ^5.7
vlucas/phpdotenv Version ^2.5
philo/laravel-blade Version ^3.1
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 woann/light-php contains the following files

Loading the files please wait ....