Download the PHP package monkdev/monkcms without Composer
On this page you can find all versions of the php package monkdev/monkcms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download monkdev/monkcms
More information about monkdev/monkcms
Files in monkdev/monkcms
Package monkcms
Short Description A PHP client for accessing the MonkCMS API in non-website environments.
License MIT
Homepage https://github.com/MonkDev/monkcms-php
Informations about the package monkcms
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.
Overview
Install
Using Composer, add monkdev/monkcms
to your
composer.json
:
Or:
Configure
Configuration can be done by passing an array to the constructor:
Or after instantiation by calling setConfig
:
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:
While only the siteId
and the siteSecret
are required, the following configuration values are avaialble for use
Request
Requesting content is simple:
If you're familiar with getContent
from monkcms.php
,
sermon
is the module,detail
is thedisplay
value, andsermon-slug
is thefind
value (optional).
Additional parameters can be passed in an array as the second argument:
If you'd prefer to forgo the slash-separated string format, you can instead pass a single array argument with all of the values:
get
returns JSON as described by the API docs
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
If you want to use show
key to format API output, there are 2 ways
1. Using inline string
For example:
2. Using an array
For example:
Development
Composer is used for dependency management and task running. Start by installing the dependencies:
Tests
Testing is done with PHPUnit. To run the tests:
Continuous integration is setup through Travis CI to run the tests against PHP v5.6, v7.0, and v7.1. (Circle CI 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 during CI for tracking over time. Badges for both are dispayed at the top of this README.
Documentation
phpDocumentor is used for code documentation. To build:
This creates a doc
directory (that is ignored by git).
Quality
A number of code quality tools are configured to aid in development. To run them all at once:
Each tool can also be run individually:
- php -l:
$ composer phplint
- PHP_CodeSniffer:
$ composer phpcs
- PHP Copy/Paste Detector:
$ composer phpcpd
- PHPLOC:
$ composer phploc
- PHP Mess Detector:
$ composer phpmd
- SensioLabs Security Checker:
$ composer security-checker
Deployment
Publishing a release to Packagist simply requires creating a git tag:
Be sure to choose the correct version by following Semantic Versioning.
Publish Documentation
After releasing a new version, the documentation must be manually built and
published to the gh-pages
branch.