vrakita / contentlocalizedapi
此包的最新版本(v1.2)没有可用的许可信息。
内容本地化 PHP 同步 API
v1.2
2017-05-28 19:28 UTC
Requires
- vlucas/phpdotenv: ^2.2
Requires (Dev)
- phpunit/phpunit: 4.7.*
README
安装
将以下内容添加到您的 composer.json 文件中
{
"require": {
"vrakita/contentlocalizedapi": "1.*"
},
"config": {
"preferred-install": "dist"
}
}
更新您的依赖项
composer update
使用您的 ContentLocalized 凭据创建 .env 文件
CL_EMAIL=mymail@firstbeatmedia.com
CL_PASSWORD=secretpassword
CL_SSL=1
示例
<?php
require 'vendor/autoload.php';
use CLAPIClient\Clients\DVIP\CompletedTranslation;
try {
$sync = new CompletedTranslation(__DIR__);
$response = $sync
// Set author of string changes
->setWriter('writer@test.ff')
// Set string which is translating
->setString('new string 2')
// Set translation of string
->setTranslatedString('hello world uk')
// Set language of translation
->setTranslationLanguage('rs')
// Sandbox mode http://dev.contentlocalized.com/
->sandbox()
// Log errors to directory
->log(__DIR__)
// Send request
->send();
} catch (\Exception $e) {
echo $e->getMessage();
exit;
}
var_dump($response);