phitFlyer is a PHP library which provides calling bitFLyer-API. It provides multiple access methods, such as array, class.
- simple interface
- return values are result of json decoding(array/object), but it also has object interface by using decorator class.
- bundles benchmark class which can be used alternatively.
use Stk2k\PhitFlyer\PhitFlyerClient;
$client = new PhitFlyerClient();
$markets = $client->getMarkets();
foreach($markets as $idx => $market){
echo $idx . '.' . PHP_EOL;
echo 'product_code:' . $market->product_code . PHP_EOL;
echo 'alias:' . (isset($market['alias']) ? $market['alias'] : '') . PHP_EOL;
}
use Stk2k\PhitFlyer\PhitFlyerClient;
use Stk2k\PhitFlyer\PhitFlyerObjectClient;
$client = new PhitFlyerObjectClient(new PhitFlyerClient());
$markets = $client->getMarkets();
foreach($markets as $idx => $market){
echo $idx . '.' . PHP_EOL;
echo 'product_code:' . $market->getProductCode() . PHP_EOL;
echo 'alias:' . $market->getAlias() . PHP_EOL;
}
use Stk2k\PhitFlyer\PhitFlyerClient;
use Stk2k\PhitFlyer\PhitFlyerBenchmarkClient;
$client = new PhitFlyerBenchmarkClient(
new PhitFlyerClient(),
function ($m, $e) use(&$method, &$elapsed){
echo "[$m]finished in $e sec" . PHP_EOL;
}
);
$client->getMarkets();
use Stk2k\PhitFlyer\PhitFlyerClient;
use Stk2k\PhitFlyer\PhitFlyerLoggerClient;
$client = new PhitFlyerLoggerClient(
new PhitFlyerClient(),
new YourLogger() // YourLogger: Psr-3 compliant logger
);
$client->getNetDriver()->setVerbose(true); // ouput detail log
use Stk2k\PhitFlyer\PhitFlyerClient;
use Stk2k\NetDriver\NetDriver\Php\PhpNetDriver;
$client = new PhitFlyerClient();
$client->setNetDriver(new PhpNetDriver()); // use file_get_contents to call web api instead of cURL function
$markets = $client->getMarkets();
- create PhitFlyerClient object.
- call API method.
- PhitFlyer returns array or object(stdClass).
PHP 5.5 or later php-mbstring php-xml
The recommended way to install phitFlyer is through Composer.
composer require stk2k/phitflyer
After installing, you need to require Composer's autoloader:
require 'vendor/autoload.php';
This software is no warranty.
We are not responsible for any results caused by the use of this software.
Please use the responsibility of the your self.
-Bitcoin: 3HCw9pp6dSq1xU9iPoPKVFyVbM8iBrrinn