pltext/sdk
Composer 安装命令:
composer require pltext/sdk
包简介
A simple PHP wrapper for the PLText API.
README 文档
README
A simple PHP wrapper for the PLText API.
Installation
You can install the package via Composer.
composer require pltext/sdk
Usage
First, ensure you have your PLText API key. You can provide it directly or load it from a .env file using a library like vlucas/phpdotenv.
require 'vendor/autoload.php'; use Dotenv\Dotenv; use Pltext\Pltext; // Example of loading from a .env file $dotenv = Dotenv::createImmutable(__DIR__); $dotenv->load(); $apiKey = $_ENV['PLTEXT_API_KEY']; // Or, provide the key directly: $apiKey = "your_pltext_api_key_here"; $client = new Pltext($apiKey); $content = "This is the text content you want to check for plagiarism."; try { $result = $client->checkContent($content); print_r($result); } catch (Exception $e) { echo 'Error: ' . $e->getMessage(); }
Local Development
For local development, you can create a .env file in the project root. Your application code (like in example.php) is responsible for loading these variables.
PLTEXT_API_KEY=your_pltext_api_key_here
PLTEXT_API_URL=http://localhost:5033/api/v1/check
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-09-16