Class RESTful_Server
- RESTful
-
RESTful_Server
Methods summary
public
|
|
public
|
|
public
|
|
public
&
|
|
public
|
|
public
|
|
public
array
&
|
|
public
string
|
|
public
array
&
|
#
getParameterFromURI( )
return uri parameters (require mod_rewrite, see also config.inc.php) - if null memvar "m_errormsg" should be checked |
public
array
&
|
|
public
array
&
|
|
public
array
|
#
authenticate( string $realm = 'protected RESTful web service', mixed $abortHtml = null )
request the client to authenticate and return the user and password as array, if no authentication is send by client the function return HTTP Error 401 to the client and abort the script. |
public
|
#
unauthorized( string $realm = 'protected RESTful web service', mixed $abortHtml = null )
return HTTP Error 401 to the client and abort the script |
public
string
|
#
createAuthToken( string $salt = '', string $algo = 'sha256' )
create a hashed authentification token for the consumer to map it with a ressource owner, this token could be stored in database to authentificate following REST requests (for more see the restful.server.complex.sample.php) |
public static
array
|
#
createAPIKey( string $username, integer $id_user = null, $algo = 'sha256' )
create/return a secure API/consumer key and secret (could be used for the GUI on Host-Side) |
public
boolean
|
#
checkAccessToken( string $accessToken, string $authToken, string $accessTokenSecret, string $timestamp, string $nonce, string $algo = 'sha1', string & $validAccessToken = null )
check the consumer/api/app/user/access token/key is valid (for more see the restful.server.complex.sample.php) |
public
array
|
|
public
boolean
|
#
checkOAuthAuthorization( string $consumer_secret, string $token_secret = '', string & $validOAuth = null )
OAuth 1.0 check consumer / token is valid for access |
public
boolean
|
#
retContent( string $content, string $content_type = 'text/xml', string $chunkOverXBytes = '5M', string $chunkBandwidth = '1Mbit/s' )
send back content (to return an error you can combine it with the function "header_http_error") |
public
boolean
|
Methods inherited from RESTful
Properties summary
private
array
|
$m_para_uri
|
#
array()
|
private
array
|
$m_para_get
|
#
array()
|
private
|
$m_logger
|
#
null
|
private
string
|
$m_content
|
#
""
|
private
array
|
$m_headers
|
#
array()
|
private
string
|
$m_obj_guid
|
#
""
|
private
array
|
$m_oauth
|
#
array()
|
public
mixed
|
$m_trace_delAfter
size before trace file will set to zero |
#
"1024K"
|
public
string
|
$m_trace_path
path for trace file |
#
""
|
public
string
|
$m_trace_file
filename of tracefile |
#
""
|
public
string
|
$m_errormsg
error message |
#
""
|
public
boolean
|
$m_validate_headers
validate the headers of request if true and set the memvar "m_errormsg", if method "getRAW" failed |
#
true
|
public
mixed
|
$m_gz_level
gz compression level, possibe values 0 - 9 | auto |
#
0
|
public
boolean
|
$m_gz_small_data
compress small data |
#
false
|
public
string
|
$m_gz_small_data_size
data smaller this size will nerver compressed |
#
"4K"
|
public
string
|
$m_trace_critical_section_id
enable critical section for write trace files |
#
null
|
public
string
|
$m_trace_critical_section_path
path to share the critical section for write trace files |
#
"./"
|
public
integer
|
$m_trace_critical_section_maxlock_ms
max lock time for zombie processes |
#
1000
|
public
integer
|
$m_trace_critical_section_sleep_ms
sleep for retry enter critical section |
#
10
|
public
boolean
|
$m_trace_sqlite
write the trace to a SQLite file instead of a text file |
#
false
|