Download the PHP package dpb587/ravelry-api without Composer

On this page you can find all versions of the php package dpb587/ravelry-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ravelry-api

A PHP library for interacting with the Ravelry API.

Consider this a functional prototype. This library's API may change. Not all the API calls have been tested.

This project is not affiliated with Ravelry.

Getting Started

The source code is located in Composer.

Download

For integration, it's easiest to require with composer...

composer.phar require dpb587/ravelry-api=dev-master

For development, it's easiest to clone with git...

git clone https://github.com/dpb587/ravelry-api-php
cd ravelry-api-php
composer.phar install

Authentication

There are two authentication methods for you to decide between. In both cases you can find the necessary keys from the apps tab of your Ravelry Pro account.

For OAuth, use an OauthTokenStorage handler and include your access and secret key...

$auth = new RavelryApi\Authentication\OauthAuthentication(
    new RavelryApi\Authentication\OauthTokenStorage\FileTokenStorage(),
    $accessKey,
    $secretKey
);

For personal use with your own account, you can use your access and personal key...

$auth = new RavelryApi\Authentication\BasicAuthentication($accessKey, $personalKey);

Usage

Create a new RavelryApi\Client, including the authentication handler you're using...

$ravelry = new RavelryApi\Client($auth);

And now you can make API calls, using the returned result like an array...

# find the first message from the inbox
$id =
    $ravelry->messages->list([ 'folder' => 'inbox' ])
    ['messages'][0]['id'];

# load and show the message
$message =
    $ravelry->messages->show([ 'id' => $id ])
    ['message'];

echo $message['content_html'];
#> <p>I&#8217;m a message from the API!</p>

# then mark it as read
$ravelry->messages->markRead([ 'id' => $id ]);

Internally, the results are an object which provides some additional values...

get_class($message);
#= 'RavelryApi\\Model'

$message->toArray();
#= ['message'=>['sent_at'=>...]]

$message->getEtag();
#= '"18aa948e83e5e6b131d6b60998690fd5"'

$message->getStatusCode();
#= 200

$message->getStatusText();
#= 'OK'

Tests

The testing code is located in phpunit.

Functional Tests

The functional tests will actually communicate with the Ravelry API to run through various API calls and validate the expected responses. You must configure a RAVELRY_TEST_ACCESS_KEY and RAVELRY_TEST_PERSONAL_KEY to use for authentication with the tests. All tests run as specifically as possible and avoid changing things that tests didn't create, however, it is testing so you should probably use a dedicated test account.

There is a ./test/cleanup.php script which will clean up any objects left behind from failed tests.

References

License

MIT License


All versions of ravelry-api with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
guzzlehttp/guzzle Version 4.0.2
guzzlehttp/guzzle-services Version 0.2.0
guzzlehttp/oauth-subscriber Version dev-master
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dpb587/ravelry-api contains the following files

Loading the files please wait ....