Class Metaphrase
Metaphrase class
Create a new instance of this class by providing your authentication credentials And execute the available API methods
Currently uses old translate API
Package: metaphrase\phpsdk
Copyright: (c) 2014-2015, Spafaridis Xenophon
License: LGPL License 2.1
Author: Spafaridis Xenophon nohponex@gmail.com
Version: 0.1.2
Uses: curl_init curl
Todo: Migrate to metaphrase api
Todo: Make sure it can be work as a script in order to assist other SDKs to download and cache the translated data
Located at metaphrase/phpsdk/Metaphrase.php
Methods summary
public
Returns
|
#
__construct( string $api_key, array $settings = [],
Create a new instance of the class using user's email and password as authentication credentials |
public
array
|
#
request( string $resource, $method =
Perform an cURL request to API server, this is an internal function |
public
array
|
#
fetch( integer $project_id, string $language_code, boolean $use_cached = TRUE )
Get all translation keys |
public
boolean
|
|
public static
|
|
public static
|
|
public
object|null
|
Magic methods summary
Constants summary
string |
VERSION
|
#
'0.1.2'
|
string |
METHOD_GET
|
#
'GET'
|
string |
METHOD_HEAD
|
#
'HEAD'
|
string |
METHOD_POST
|
#
'POST'
|
string |
METHOD_DELETE
|
#
'DELETE'
|
string |
METHOD_PUT
|
#
'PUT'
|
integer |
REQUEST_EMPTY_FLAG
|
#
0
|
integer |
REQUEST_BINARY
|
#
1
|
integer |
REQUEST_NOT_URL_ENCODED
|
#
2
|
integer |
SETTING_CURLOPT_CONNECTTIMEOUT
Setting CURLOPT_CONNECTTIMEOUT - timeout for the connect phase Pass a long. It should contain the maximum time in seconds that you allow the connection phase to the server to take. This only limits the connection phase, it has no impact once it has connected. Set to zero to switch to the default built-in connection timeout - 300 seconds. Default timeout is 300. |
#
CURLOPT_CONNECTTIMEOUT
|
integer |
SETTING_CURLOPT_TIMEOUT
Setting CURLOPT_TIMEOUT - set maximum time the request is allowed to take |
#
CURLOPT_TIMEOUT
|
Properties summary
public
|
$keyword
|
|
public
|
$project
|
|
public
|
$translated
|