aboutyou / app-sdk
ABOUT YOU app SDK
Installs: 7 525
Dependents: 0
Suggesters: 0
Security: 0
Stars: 11
Watchers: 15
Forks: 6
Open Issues: 4
Requires
- php: >=5.3
- aboutyou/auth-sdk: ~0.3
- aboutyou/cache: ~1.4.1
- guzzle/guzzle: ~3.7
- psr/log: 1.0.*
- rhumsaa/uuid: ~2.7
Requires (Dev)
- monolog/monolog: 1.*
- phpunit/phpunit: ~4.3
- dev-master
- 2.6.11
- 2.6.10
- 2.6.9
- 2.6.8
- 2.6.7
- 2.6.6
- 2.6.5
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.1
- 2.6.0
- 2.5.1
- 2.5.0
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.0
- 1.5.1
- 1.5.0
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.7
- 1.3.6
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3
- 1.2
- 1.1
- 1.0
- 1.0b1
- 1.0a2
- 1.0a1
- 0.10.6
- 0.10.5
- 0.10.4
- 0.10.3
- 0.10.2
- 0.10.1
- 0.10
- 0.9.81
- 0.9.8
- 0.9.7
- 0.9.6
- 0.9.5
- 0.9.4
- 0.9.3
- 0.9.2
- 0.9.1
- 0.9
- 0.8
- v0.0.20
- v0.0.19
- v0.0.18
- v0.0.17
- v0.0.16
- v0.0.15
- v0.0.14
- v0.0.13
- v0.0.12
- v0.0.11
This package is not auto-updated.
Last update: 2017-11-24 07:58:28 UTC
README
Documentation
See ABOUT YOU Developer Center for more Information.
Installation
The recommended way to install the ShopAPI is through Composer.
First install composer
curl -sS https://getcomposer.org/installer | php
then add the App SDK as a dependency. The SDK is available via Packagist under the aboutyou/app-sdk package.
php composer.phar require aboutyou/app-sdk
at least, after the installing was successful, you need to require the Composer's autoloader:
require 'vendor/autoload.php';
Usage
For more detailed information see ABOUT YOU Developer Center Documentation.
Caching
Example how to use the App SDK with the apc cache.
$cache = new \Aboutyou\Common\Cache\ApcCache();
$ay = new \AY($appId, $appPassword, $apiHost, null, null, $cache);
This is an example, how to pre cache facets and categories per cron (hourly pre caching is preferred). We use APC for simplicity, but you can also use memcached, redis or other supported cache systems. First you need a php script which initialize the app sdk, fetch and cache the data to your preferred cache.
#!/usr/bin/env php
<?php
// filename precache-cron.php
require 'myconfig.php';
require 'vendor/autoload.php';
$cache = new \Aboutyou\Common\Cache\ApcCache();
$ay = new \AY($appId, $appPassword, $aboutYouHost, null, null, $cache);
$ay->preCache();
Then add the script to your crontab,
to edit the cron jobs call crontab -e
on your shell
# Edit this file to introduce tasks to be run by cron.
# [snip]
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
0 * * * * * <path to your project>/precache-cron.php
Testing
To test the SDK, just copy the dist file:
cp phpunit.dist.xml phpunit.xml
and run the test:
vendor/bin/phpunit