Skip to content
This repository has been archived by the owner on May 15, 2020. It is now read-only.

NationalMuseumofDenmark/CIP-PHP-Client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this?

The National Museum of Denmark keeps all of its assets and metadata in an asset management system called Cumulus. It is used to keep track of the digitization effort, licensing and many other things pertaining to keeping a digital collection. Cumulus exposes its data for internal and external products, programmers and hobbyists in a RESTful API called CIP. The SDK described in this document wraps the CIP API for use in a PHP project.

CIP PHP Client is an independent implementation of a PHP Client for the Canto Integration Platform, developped for the National Museum of Denmark.

Getting started!

Using Composer

A preferred way of getting the code into your project, is using the PHP package manager Composer. To install composer, following the guide at https://getcomposer.org/

Once installed, include the "national-museum-of-denmark/cip-php-client" in your composer.json, like so

{
	"require": {
		"national-museum-of-denmark/cip-php-client": "dev-master"
	},
	"repositories": [
		{
			"type": "vcs",
			"url":  "git@github.com:NationalMuseumofDenmark/CIP-PHP-Client.git"
		}
	]
}

Run ´composer install´ to download and install the library into your PHP project, and you should be up and running.

Require the autoload.php and start experimenting

Ones downloaded, you can start experimenting, for inspiration look into example.php

<?php
// Include and bootstrap the client.
require("./vendor/autoload.php");

// Instantiate the CIP client.
$client = new \CIP\CIPClient('http://samlinger.natmus.dk/', false);

// Request the system version.
$response = $client->system()->getversion();

// Print the version returned from the service.
print_r($response['version']);
?>

Documentation

The source code of the CIP-PHP-Client is annotated with documentation, which is published on http://natmus.demo.bitblueprint.com/cip-php-client/doc/

Contribute to the project

Installing development requirements

Once you have composer installed, navigate to the git repository of this project, running

cd ./vendor/national-museum-of-denmark/cip-php-client

and run

composer install --dev

Buidling the documentation

If you make changes to the sourcecode and want to build the documentation, you need a tool such as phpdocumentor (phpdoc), this was installed in the previous step of this guide.

To generate the documentation to a '''doc''' folder, run the shell-script located in the root of the repository

./generate-documentation.sh

Manually - If you choose not to use composer

Alternatively you can follow the installation guide at http://manual.phpdoc.org/HTMLSmartyConverter/HandS/ric_INSTALL.html, essentially telling you to run

pear upgrade PhpDocumentor

Run the command to generate the HTML documentation from the source-code, which looks something like

phpdoc --title "Natmus CIP-PHP-Client" --defaultpackagename "Natmus CIP-PHP-Client" -t doc/ -d src/

Running the tests

Again you have to download a tool to run the unit tests, this is phpunit, which is also included when you run the '''composer install''' command.

To run the tests first defining the environment variables, then invoke the phpunit tool as follows.

PHPUNIT="./vendor/bin/phpunit"
export CIP_SERVER="http://samlinger.natmus.dk/";
export CIP_USER="cip-bitblueprint";
export CIP_PASSWORD="wZIgA9MkbAb3";
export CIP_SERVERADDRESS="localhost";
export TEST_CATALOG_ALIAS="bitblueprint";
export TEST_CATALOG_NAME="Bit Blueprint";
export TEST_CATALOG_VIEW="web";
export DEBUGGING="true";
$PHPUNIT --debug tests

About

A PHP Client for the Canto Integration Platform

Resources

License

Stars

Watchers

Forks

Packages

No packages published