https://github.com/gitana/cloudcms-php-driver
Cloud CMS PHP Driver
https://github.com/gitana/cloudcms-php-driver
Last synced: 8 months ago
JSON representation
Cloud CMS PHP Driver
- Host: GitHub
- URL: https://github.com/gitana/cloudcms-php-driver
- Owner: gitana
- License: apache-2.0
- Created: 2019-01-25T17:25:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-01-23T02:46:18.000Z (over 1 year ago)
- Last Synced: 2025-01-23T03:27:17.323Z (over 1 year ago)
- Language: PHP
- Homepage: https://gitana.io
- Size: 43 KB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cloud CMS PHP Driver
The [Cloud CMS](https://gitana.io) 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:
```php
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("");
// List Branches
$branches = $repository->listBranches();
// Read Branch
$branch = $repository->readBranch("");
// Read Node
$node = $branch->readNode("");
// 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
- Cloud CMS: https://gitana.io
- Github: http://github.com/gitana/cloudcms-php-driver
- PHP Driver Download: https://packagist.org/packages/cloudcms/cloudcms
- Cloud CMS Documentation: https://gitana.io/documentation.html
- Developers Guide: https://gitana.io/developers.html
## Support
For information or questions about the PHP Driver, please contact Cloud CMS
at [support@cloudcms.com](mailto:support@cloudcms.com).