mcprohosting / skinner
用于获取Minecraft头部和皮肤的库!
1.1.1
2015-08-01 02:12 UTC
Requires
- php: >=5.4.0
- ext-curl: *
- intervention/image: 1.6.*
Requires (Dev)
- mockery/mockery: 0.9.*
- phpunit/phpunit: 3.7.*
- satooshi/php-coveralls: v0.6.0
README
Skinner是一个相当简单的库,用于获取Minecraft头部和皮肤以供您的应用程序使用。
安装
将以下内容添加到您的composer.json文件的requires部分,然后运行composer update
"mcprohosting/skinner": "dev-master"
用法
// Example 1: save a player's skin and head to a file:
file_put_contents('steve_skin.png', Skinner::user('steve')->skin());
file_put_contents('steve_skin.png', Skinner::user('steve')->head());
// Or, more efficiently, in a way that will only cause the skin to be downloaded once
$user = Skinner::user('steve');
file_put_contents('steve_skin.png', $user->skin());
file_put_contents('steve_skin.png', $user->head());
// Calls to the $user are automatically passed to Intervention images. So you can, for example:
$user = Skinner::user('steve');
file_put_contents('steve_skin.png', $user->skin()->resize(300, 300));
// Or, manually save it in another format, like jpg at 70% quality
$user = Skinner::user('steve');
file_put_contents('steve_skin.jpg', $user->encode('jpg', 70));