mouyong / puyingcloud-sdk
puyingcloud sdk
Installs: 1 460
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- php: >=7.0
- hanson/foundation-sdk: ^2.0|^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.15
- mockery/mockery: ^1.2
- phpunit/phpunit: ~6
This package is auto-updated.
Last update: 2024-11-24 15:10:14 UTC
README
普赢云 sdk.
Installing
$ composer require mouyong/puyingcloud-sdk -vvv
Usage
use Yan\PuyingCloudSdk\Kernel\ContentFormatter;
require __DIR__.'/vendor/autoload.php';
$sdk = new \Yan\PuyingCloudSdk\PuyingCloudSdk([
'debug' => true, // 必须有,不然 foundation 72 行会报 Notice 未定义索引 debug 错误
'phone' => 'your-phone-number',
'password' => 'your-password',
'log' => [
'file' => __DIR__.'/runtime.log',
'level' => 'debug',
'permission' => 0777,
],
'cache' => new \Doctrine\Common\Cache\FilesystemCache(__DIR__.'/cache/'),
]);
class TestFormatter extends ContentFormatter implements \Yan\PuyingCloudSdk\Contracts\Formatter {
public function format()
{
$title = $this->title($this->content['title']);
$this->result = $title;
}
}
$order = [
'title' => '123',
'desc' => '456',
];
try {
echo json_encode($sdk->printer->createPrintTask($sn, '测试打印', new TestFormatter($order)));
echo json_encode($sdk->printer->getPrinterlist());
} catch (\Exception $e) {
echo $e->getMessage();
}
Contributing
You can contribute in one of three ways:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
- Contribute new features or update the wiki.
The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.
License
MIT