jsonms/php
最新稳定版本:1.0.13
Composer 安装命令:
composer require jsonms/php
包简介
A JSON.ms requests handler to install on your own server.
README 文档
README
A PHP request handler to use as a endpoint in json.ms.
Installation
You can install jsonms/php via composer:
Requirements
composer require jsonms/php
Preparation
Make sure you first created a endpoint in the JSON.ms Settings section of your interface. Obtain your secret and cypher key using the Get button of each field.
Configuration
For auto-configuration, you can launch the install script.
php vendor/jsonms/php/install.php
Or create a index.php file manually in your directory.
<?php use JSONms\JSONms; require 'vendor/autoload.php'; // Load JSONms configurations $jsonms = new JSONms( 'PRIVATE_DATA_PATH', // Where to read/save your data in your file system? 'PUBLIC_URL', // Public path of your server endpoint 'ACCESS_CONTROL_ALLOW_ORIGIN', // Set to "https://json.ms" if you do not need your own instance of JSON.ms. You can add multiple URLs by seperating them by a comma. 'SECRET_KEY', // Obtain from your endpoint in Settings panel in Advanced mode. 'CYPHER_KEY', // Obtain from your endpoint in Settings panel in Advanced mode. ); // Handle errors (if required) and requests $jsonms->handleErrors(); // Optional. Remove if you prefer to handle errors yourself. $jsonms->handleRequests(); // You can pass an URI param. (ex: /data/get/YOUR_HASH)
Usage
To test locally, you can start a PHP built-in Web server:
php -S localhost:8080 index.php
Now you can read, save, upload and delete data from your server with any project bound to the endpoint you configured as long as this server is running!
统计信息
- 总下载量: 24
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-03