jahuty/snippets-php

This package is abandoned and no longer maintained. The author suggests using the jahuty/jahuty-php package instead.

Jahuty's PHP client

v1.0.0 2019-09-02 16:02 UTC

This package is auto-updated.

Last update: 2020-03-08 18:20:32 UTC


README

CircleCI

snippets-php

Jahuty's PHP client.

Installation

This library requires PHP 7.3+.

It is multi-platform, and we strive to make it run equally well on Windows, Linux, and OSX.

It should be installed via Composer. To do so, add the following line to the require section of your composer.json file (where x is the latest major version), and run composer update:

{
   "require": {
       "jahuty/snippets-php": "^x"
   }
}

Usage

Use the key() method to set your API key (ideally, once during startup):

Snippet::key('123abc456def789ghi');

Then, use the get() method to retrieve a snippet (cast the return value to a string):

<!doctype html>
<html>
<head>
    <title>My awesome example</title>
</head>
<body>
    <?php echo Snippet::get(123); ?>
</body>

License

This library is licensed under the MIT license.

Compliance

This library strives to adhere to the following standards:

  1. Keep a Changelog 1.0
  2. PSR-2
  3. Semantic Versioning 2.0

If you spot an error, please let us know!