定制 cloudcms/cloudcms 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

cloudcms/cloudcms

最新稳定版本:1.1.2

Composer 安装命令:

composer require cloudcms/cloudcms

包简介

PHP Driver for Cloud CMS

关键字:

README 文档

README

The Cloud CMS PHP driver is a client library used to facilitate connections to the Cloud CMS API. The driver handles OAuth authentication and token management, HTTPS calls, and provides convenient methods and classes with which to perform content operations. It works against Cloud CMS instances on our SaaS platform as well as on-premise installations.

Installation

To install, run:

composer require cloudcms/cloudcms

Examples

Below are some examples of how you might use this driver:

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);

Tests

To run the tests for this driver, ensure that you have a gitana.json file in the driver directory, then run:

composer test

Resources

Support

For information or questions about the PHP Driver, please contact Cloud CMS at support@cloudcms.com.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2019-01-25