Download the PHP package zhanshop/kernel without Composer

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

zhanshop框架核心

本系统采用RESTFUL应用程序的设计风格开发,返回结构为JSON格式, 所有资源都共享统一的接口,以便在客户端和服务器之间传输状态。使用的是标准的 HTTP 方法,比如 GET、PUT、POST 和 DELETE。 注意: POST请求参数中添加 _method = 方法名 可以伪造请求方法。

主要新特性

安装

composer require zhanshop/kernel

目录结构

├─app 应用目录
│  ├─api api目录
│  │  ├─v1_0_0 api版本
│  │  │  ├─controller api控制器
│  │  │  │  ├─Index.php 
│  │  │  ├─service api服务
│  │  │  │  ├─IndexService.php
│  │  ├─v2_0_0
│  ├─console 控制台目录
│  ├─library 封装library
│  ├─middleware 控制器中间件
│  ├─model 数据库模型
│  ├─provide 服务提供者
├─cmd.php 控制台程序入口
├─composer.json
├─config 配置目录
├─public 网站目录
├─route 路由
├─runtime 运行时
├─vendor 框架目录及composer包

使用方法

1.生成路由

php cmd.php api:create // 使用命令生成路由
php cmd.php apidoc:manager // 当代码和注释发生变更使用该命令进行 修改/删除/清空/回滚/生成
对框架生成的service进行业务开发即可

2.数据模型

模型定义

namespace app\model;

    使用案例
    App::database()->model('表名')->where(['id' => 123])->find();  // 查询单个数据
    App::database()->model('表名')->where(['a' => 123])->finder(); // 分页查询
    App::database()->model('表名')->save([...]);  // 新增数据
    App::database()->model('表名')->where(['id' => 123])->delete(); // 删除

    App::database()->model('user_play_log')->db()->getConnection()->query(...) // 使用当前模型连接执行原生sql查询

    事务 当闭包中的代码发生异常会自动回滚
    App::database()->transaction(function(){
        ....
    });
    分布式事务
    App::database()->transactionXa(function(){
        ....
    });

    模型调用使用App::database()->model('表名'),更多数据模型操作可详见 https://www.kancloud.cn/manual/think-orm/1258003

All versions of kernel with dependencies

PHP Build Version
Package Version
Requires topthink/think-orm Version ^2.0
php Version >=8.0.0
guzzlehttp/guzzle Version ^7.4
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 zhanshop/kernel contains the following files

Loading the files please wait ...