cloudcms / cloudcms
Cloud CMS 的 PHP 驱动程序
1.1.2
2022-01-04 21:13 UTC
Requires
- league/oauth2-client: ^2.4
Requires (Dev)
- phpunit/phpunit: ^7.5
This package is not auto-updated.
Last update: 2024-09-25 08:03:22 UTC
README
Cloud CMS PHP 驱动程序是一个客户端库,用于简化与 Cloud CMS API 的连接。驱动程序处理 OAuth 身份验证和令牌管理,HTTPS 请求,并提供方便的方法和类,用于执行内容操作。它适用于我们的 SaaS 平台上的 Cloud CMS 实例,以及本地安装。
安装
要安装,请运行
composer require cloudcms/cloudcms
示例
以下是一些使用此驱动程序的示例
use CloudCMS\CloudCMS; // Load configuration from gitana.json file $config_string = file_get_contents("gitana.json"); $config = json_decode($config_string, true); // Connect to CloudCMS $client = new CloudCMS(); $platform = $client->connect($config); // List Repositories $repositories = $platform->listRepositories(); // Read Repository $repository = $platform->readRepository("<repositoryId>"); // List Branches $branches = $repository->listBranches(); // Read Branch $branch = $repository->readBranch("<branchId>"); // Read Node $node = $branch->readNode("<nodeId>"); // Create Node $obj = array( "title" => "Twelfth Night", "description" => "An old play" ); $newNode = $branch->createNode($obj); // Query Nodes $query = array( "_type" => "store:book" ); $pagination = array( "limit" => 2 ); $queriedNodes = $branch->queryNodes($query, $pagination); // Find Nodes $find = array( "search" => "Shakespeare", "query" => array( "_type" => "store:book" ) ); $foundNodes = $branch->findNodes($find);
测试
要为此驱动程序运行测试,请确保在驱动程序目录中有一个 gitana.json
文件,然后运行
composer test
资源
- Cloud CMS: https://www.cloudcms.com
- Github: http://github.com/gitana/cloudcms-php-driver
- PHP 驱动程序下载: https://packagist.org.cn/packages/cloudcms/cloudcms
- Cloud CMS 文档: https://www.cloudcms.com/documentation.html
- 开发者指南: https://www.cloudcms.com/developers.html
支持
有关 PHP 驱动程序的信息或问题,请联系 Cloud CMS,邮箱:support@cloudcms.com。