dev-master
9999999-dev http://plainmark.comPlainmark SDK provides access to the Plainmark Analytical Engine
MIT
The Requires
- php >=5.3.0
by Dennis Prochko
Plainmark SDK provides access to the Plainmark Analytical Engine
Plainmark SDK for PHP is a simple class that provides a wrapper for HTTP-based RESTful interface to the Plainmark analytical engine., (*1)
It allows to query Plainmark database for applications tested and to request an application to be analyzed., (*2)
The SDK contains results interpretor - it allows to convert raw analytical data into human-readable format: application's five-point rating and its explanation (annotation)., (*3)
If using Composer, add our package to your composer.json
and run composer update
., (*4)
"require": { "plainmark/sdk-php": "dev-master" }
Otherwise, you can simply include plainmark.php
file into your source code., (*5)
You can find examples on how to use the library in the tests
folder.
Typical usage is:, (*6)
<?php // when using Composer's autoload feature require_once 'vendor/autoload.php'; // otherwise require_once 'plainmark.php'; use Plainmark\Plainmark; use Plainmark\App;
$plainmark = new Plainmark('your_login', 'your_password');
$id = $plainmark->find('com.android.example.package');
To submit an apk file:, (*7)
$id = $plainmark->submit('en-US', 'App Title', 'App description', 'App Vendor', '/path/to/package.apk');
To submit AppDF file:, (*8)
$id = $plainmark->submitAppDF('App Vendor', '/path/to/description.appdf');
$app = $plainmark->getApp($id);
To download the APK file of the analyzed application:, (*9)
$content = $plainmark->download($id);
$score = $plainmark->getScore($app); echo "Rating: {$score['stars']} stars ({$score['score']}/{$score['max_score']}) points\n"; echo "Annotation:\n"; foreach ($plainmark->getAnnotations($app) as $item) echo " * {$item}\n";
The library uses exceptions in case of errors - use try-catch when needed., (*10)
You can customize interpretation of the app analysis. Use config.csv
to change
the analysis description and its score., (*11)
config.csv
is a tab delimited sheet file. The file contains a number of
conditions, every condition is on one line. Every line defines a string in the analysis
description and the number of points to add to the score calculation,
should the condition in the given line be satisfied., (*12)
PLEASE NEVER CHANGE THE FIELDS ONE, TWO and THREE. These columns are used for the internal purposes only., (*13)
The rest of the fields are:, (*14)
Plainmark SDK provides access to the Plainmark Analytical Engine
MIT