bein-sports/openl10n-sdk
最新稳定版本:v0.1.0
Composer 安装命令:
composer require bein-sports/openl10n-sdk
包简介
The API client for openl10n
README 文档
README
Openl10n SDK is a PHP client for openl10n API. It uses Guzzle library (version 4) to handle HTTP requests.
Usage
<?php require __DIR__.'/vendor/autoload.php'; use Openl10n\Sdk\Api; use Openl10n\Sdk\Config; use Openl10n\Sdk\Model\Resource; $rootApi = new Api((new Config('openl10n.dev'))->setAuth('user', 'user')); // Get API entry points $projectApi = $rootApi->getEntryPoint('project'); $resourceApi = $rootApi->getEntryPoint('resource'); // Get project by its slug $demo = $projectApi->get('demo'); // Create new resource file $resource = new Resource($demo->getSlug()); $resource->setPathname('path/to/messages.en.yml'); $resourceApi->create($resource); // Import some translations $resourceApi->import($resource, 'path/to/messages.en.yml', 'en'); // Export content $content = $resourceApi->export($resource, 'fr'); file_put_contents('path/to/messages.fr.yml', $content);
License
OpenLocalization SDK is released under the MIT License. See the bundled LICENSE file for details.
统计信息
- 总下载量: 7.89k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-06-03