此包最新版本(v1.1.1)没有可用的许可证信息。

Nicehalf API

v1.1.1 2023-02-10 21:33 UTC

This package is auto-updated.

Last update: 2024-09-11 00:48:07 UTC


README

简介

NiceHalf API 是一个 RESTful API,允许您在 NiceHalf 数据库上执行认证、授权和 CRUD 操作。

入门指南

先决条件

安装

  1. 运行以下命令安装依赖项
composer require nicehalf/api
  1. 在项目根目录中创建一个 index.php 文件,并添加以下代码
<?php

require_once __DIR__ . '/vendor/autoload.php';

use NiceHalf\Api\AuthAPI;
use NiceHalf\Api\CrudAPI;
use NiceHalf\Api\LicenseAPI;

$auth = new AuthAPI();
$license = new LicenseAPI();
$crud = new CrudAPI();
  1. 运行以下命令启动服务器
php -S localhost:8000

用法

AuthAPI

登录

$auth->auth();

登出

$auth->logout();

获取用户

$auth->getUser();

LicenseAPI

检查 API 连接

$license->check_connection();

激活许可证

$license->activate_license($license_key, $client_username);

验证许可证

$license->verify_license($time_based_check = false, $license_key = null, $client_username = null);

停用许可证

$license->deactivate_license($license_key, $client_username);

检查更新

$license->check_update();

CrudAPI

获取行

$crud->get_rows($table_name, $where = [], $order_by = null, $limit = null, $offset = null);

获取单行

$crud->get_row($table_name, $where = []);

插入行

$crud->insert($table_name, $data);

更新行

$crud->update($table_name, $data, $where = []);

删除行

$crud->delete($table_name, $where = []);

许可证

本项目采用 MIT 许可证 - 您可以随意使用它。

致谢

版权

NiceHalf API 是 © 2023 NiceHalf. 版权所有。

联系方式