PHPackages                             monkdev/monkcms - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. monkdev/monkcms

ActiveLibrary[API Development](/categories/api)

monkdev/monkcms
===============

A PHP client for accessing the MonkCMS API in non-website environments.

v0.6.0(3y ago)23193MITPHPPHP &gt;=5.3.0

Since Jan 12Pushed 3y ago8 watchersCompare

[ Source](https://github.com/MonkDev/monkcms-php)[ Packagist](https://packagist.org/packages/monkdev/monkcms)[ Docs](https://github.com/MonkDev/monkcms-php)[ RSS](/packages/monkdev-monkcms/feed)WikiDiscussions dev Synced 2mo ago

READMEChangelog (6)Dependencies (8)Versions (8)Used By (0)

MonkCMS PHP
===========

[](#monkcms-php)

[![Latest Stable Version](https://camo.githubusercontent.com/d6b80f04a3fda711020ad662898581773673543bc4b3495419b965bf83c73b7c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f6e6b6465762f6d6f6e6b636d732e7376673f7374796c653d666c6174)](https://packagist.org/packages/monkdev/monkcms)[![Build Status](https://camo.githubusercontent.com/e74a2841092fc817a0c91154857bf7bc4254861ce0f66a29862ae3f8809e2ce2/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4d6f6e6b4465762f6d6f6e6b636d732d7068702f6465762e7376673f7374796c653d666c6174)](https://travis-ci.org/MonkDev/monkcms-php)[![codecov](https://camo.githubusercontent.com/01cbf45df85883019e2100ea373452fc35696e2e1515fa14520954fd81f905e3/68747470733a2f2f636f6465636f762e696f2f67682f4d6f6e6b4465762f6d6f6e6b636d732d7068702f6272616e63682f6465762f67726170682f62616467652e737667)](https://codecov.io/gh/MonkDev/monkcms-php)[![Dependency Status](https://camo.githubusercontent.com/8ee90abdab630f1fc899b6da15c439502a7f1f2c7080059a99868a7d2b36991d/68747470733a2f2f696d672e736869656c64732e696f2f67656d6e617369756d2f4d6f6e6b4465762f6d6f6e6b636d732d7068702e7376673f7374796c653d666c6174)](https://gemnasium.com/MonkDev/monkcms-php)

A PHP client for accessing the MonkCMS API in non-website environments.

While `monkcms.php` is great for building websites, it includes many features that simply aren't necessary — and make it hard to use — in other environments: sessions, caching, Easy Edit, etc. This library strips all of that away to provide only what's absolutely necessary to access content through the MonkCMS API. It's ideal for use in web apps, command line scripts, APIs, and more.

- [Documentation](https://monkdev.github.io/monkcms-php/classes/Monk.Cms.html)

Overview
--------

[](#overview)

### Install

[](#install)

Using [Composer](http://getcomposer.org), add `monkdev/monkcms` to your `composer.json`:

```
{
  "require": {
    "monkdev/monkcms": "~0.6"
  }
}
```

```
$ composer update
```

Or:

```
$ composer require monkdev/monkcms:~0.6
```

### Configure

[](#configure)

Configuration can be done by passing an array to the constructor:

```
$cms = new Monk\Cms(array(
    'siteId'     => 12345,
    'siteSecret' => 'secret'
));
```

Or after instantiation by calling `setConfig`:

```
$cms->setConfig(array(
    'siteId'     => 12345,
    'siteSecret' => 'secret'
));
```

When a configuration value isn't set, it falls back to a sensible default in many cases. These defaults can be changed to help alleviate repeating the same configuration in multiple places:

```
Monk\Cms::setDefaultConfig(array(
    'siteId'     => 12345,
    'siteSecret' => 'secret'
));
```

While only the `siteId` and the `siteSecret` are required, the following configuration values are avaialble for use

```
$defaultConfig = array(
    'request'    => null, // Override the default Http Request library used in the package
    'siteId'     => null, // Required
    'siteSecret' => null, // Required
    'cmsCode'    => 'EKK', // Override the default CMS Code
    'cmsType'    => 'CMS', // Override the default CMS Type (Sermon Cloud/Church Cloud vs CMS Content)
    'url'        => 'http://api.monkcms.com' // Override the default API Endpoint
);
```

### Request

[](#request)

Requesting content is simple:

```
$content = $cms->get('sermon/detail/sermon-slug');
```

If you're familiar with `getContent` from `monkcms.php`,

- `sermon` is the module,
- `detail` is the `display` value, and
- `sermon-slug` is the `find` value (optional).

Additional parameters can be passed in an array as the second argument:

```
$content = $cms->get('sermon/list', array(
    'nonfeatures' => true,
    'howmany'     => 5
));
```

If you'd prefer to forgo the slash-separated string format, you can instead pass a single array argument with all of the values:

```
$content = $cms->get(array(
    'module'  => 'sermon',
    'display' => 'list',
    'howmany' => 5
));
```

`get` returns [JSON as described by the API docs](http://developers.monkcms.com/article/json/)in associative array form. So, for example, a sermon's title can be accessed at `$content['show']['title']`.

If a failure occurs, `get` throws a `Monk\Cms\Exception`.

### Multiple shows

[](#multiple-shows)

If you want to use `show` key to format API output, there are 2 ways

#### 1. Using inline string

[](#1-using-inline-string)

For example:

```
$cms->get(array(
  'module'  => 'smallgroup',
  'display' => 'list',
  'order' => 'recent',
  'emailencode' => 'no',
  'howmany' => 1,
  'page' => 1,
  'show' => "___starttime format='g:ia'__ __endtime format='g:ia'__",
));
```

#### 2. Using an array

[](#2-using-an-array)

For example:

```
$cms->get(array(
  'module'  => 'smallgroup',
  'display' => 'list',
  'order' => 'recent',
  'emailencode' => 'no',
  'howmany' => 1,
  'page' => 1,
  'show' => [
    "__starttime format='g:ia'__",
    "__endtime format='g:ia'__"
  ]
));
```

Development
-----------

[](#development)

[Composer](http://getcomposer.org) is used for dependency management and task running. Start by installing the dependencies:

```
$ composer install
```

### Tests

[](#tests)

Testing is done with [PHPUnit](http://phpunit.de). To run the tests:

```
$ composer test
```

Continuous integration is setup through [Travis CI](https://travis-ci.org/MonkDev/monkcms-php)to run the tests against PHP v5.6, v7.0, and v7.1. ([Circle CI](https://circleci.com/gh/MonkDev/monkcms-php)is also setup to run the tests against PHP v5.6, but is backup for now until multiple versions can easily be specified.) The code coverage results are sent to [Codecov](https://codecov.io/gh/MonkDev/monkcms-php) during CI for tracking over time. Badges for both are dispayed at the top of this README.

### Documentation

[](#documentation)

[phpDocumentor](http://phpdoc.org) is used for code documentation. To build:

```
$ composer phpdoc
```

This creates a `doc` directory (that is ignored by git).

### Quality

[](#quality)

A number of code quality tools are configured to aid in development. To run them all at once:

```
$ composer quality
```

Each tool can also be run individually:

- [php -l](http://www.php.net/manual/en/function.php-check-syntax.php): `$ composer phplint`
- [PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer): `$ composer phpcs`
- [PHP Copy/Paste Detector](https://github.com/sebastianbergmann/phpcpd): `$ composer phpcpd`
- [PHPLOC](https://github.com/sebastianbergmann/phploc): `$ composer phploc`
- [PHP Mess Detector](http://phpmd.org): `$ composer phpmd`
- [SensioLabs Security Checker](https://github.com/sensiolabs/security-checker): `$ composer security-checker`

Deployment
----------

[](#deployment)

Publishing a release to [Packagist](https://packagist.org) simply requires creating a git tag:

```
$ git tag -a vMAJOR.MINOR.PATCH -m "Version MAJOR.MINOR.PATCH"
$ git push origin vMAJOR.MINOR.PATCH
```

Be sure to choose the correct version by following [Semantic Versioning](http://semver.org).

### Publish Documentation

[](#publish-documentation)

After releasing a new version, the documentation must be manually built and published to the `gh-pages` branch.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~425 days

Recently: every ~526 days

Total

6

Last Release

1281d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/090c5b1fd0cb6c65565e01c7fdeea26f8d5aea018117a668caaa8011880b3d04?d=identicon)[skylerkatz](/maintainers/skylerkatz)

---

Top Contributors

[![jstayton](https://avatars.githubusercontent.com/u/98357?v=4)](https://github.com/jstayton "jstayton (14 commits)")[![skylerkatz](https://avatars.githubusercontent.com/u/7297992?v=4)](https://github.com/skylerkatz "skylerkatz (12 commits)")[![DaveZMB](https://avatars.githubusercontent.com/u/57679673?v=4)](https://github.com/DaveZMB "DaveZMB (2 commits)")

---

Tags

cmsmonkmonkdevmonkcmsekklesiaekklesia360

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/monkdev-monkcms/health.svg)

```
[![Health](https://phpackages.com/badges/monkdev-monkcms/health.svg)](https://phpackages.com/packages/monkdev-monkcms)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[craftcms/element-api

Create a JSON API for your elements in Craft

503701.3k8](/packages/craftcms-element-api)[contentful/contentful-bundle

A Symfony Bundle to integrate the Contentful CDA SDK

33574.4k2](/packages/contentful-contentful-bundle)[getkirby/kql

Kirby Query Language

15124.3k](/packages/getkirby-kql)[riclep/laravel-storyblok

A Laravel wrapper around the Storyblok API to provide a familiar experience for Laravel devs

6272.7k4](/packages/riclep-laravel-storyblok)[wrav/oembed

A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.

36205.0k3](/packages/wrav-oembed)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
