squidex/squidex 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

squidex/squidex

最新稳定版本:1.2.1

Composer 安装命令:

composer require squidex/squidex

包简介

Client SDK for Squidex Headless CMS

README 文档

README

The Squidex PHP library provides access to the Squidex API from PHP.

Requires PHP 7 or higher.

Status

Version Shield Packagist PHP Version

Documentation

API reference documentation is available here.

Installation

composer install @squidex/squidex

Usage

use Squidex\Client\Configuration;
use Squidex\Client\SquidexClient;

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

$config = new Configuration();
$config->setClientId('client-id');
$config->setClientSecret('client-secret');
$config->setAppName('my-app');
// $config->setHost('https://your.squidex-deployment');

$client = new SquidexClient($config);

$response = $client->rules()->runRule("rule-id", true);

echo "Received response from Squidex!\n$response\n";

Handling errors

When the API returns a non-success status code (4xx or 5xx response), a subclass of ApiException will be thrown:

use Squidex\Client\ApiException;

try {
    $response = $client->rules()->runRule("rule-id", true);
} catch (err) {
  if (ApiException $) {
    echo $e->getMessage();
  }
}

Generation Config

To generate the config you have to execute the following steps.

  1. Run a Squidex version locally.
  2. Run the /api/docs URL to get the OpenAPI spec.
  3. Copy the OpenAPI spec to this repository.
  4. Run the generator:
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/openapi.json -g php --template-dir  /local/templates -o /local/ -c /local/openapi-config.yml

Releases

To create a new release, just create a tag. Packagist will use this tag to calculate the version.

Contributing

While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!

On the other hand, contributions to the README are always very welcome!

统计信息

  • 总下载量: 2.25k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-09-05