Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tidal/ape_php
PHP Client Library for APE Ajax Push Engine
https://github.com/tidal/ape_php
Last synced: 6 days ago
JSON representation
PHP Client Library for APE Ajax Push Engine
- Host: GitHub
- URL: https://github.com/tidal/ape_php
- Owner: tidal
- Created: 2010-03-09T00:49:08.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2010-03-16T18:33:44.000Z (over 14 years ago)
- Last Synced: 2023-03-11T00:22:18.075Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 521 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
APE_PHP
==============Lightweight PHP Client Library to Connect to an APE (APE Ajax Push Engine) server.
Fully unit tested with PHPUnit.API
------------------------
see:
[http://tidal.github.com/APE_PHP/docs/api/annotated.html](http://tidal.github.com/APE_PHP/docs/api/annotated.html)USAGE
------------------------This example is meant to be used as a replacement for the PHP code
found in the APE_JSF Controller demo.$APEPassword,
'raw' => 'postmsg',
'channel' => 'testchannel',
'data' => array(
'message' => 'Hello APE'
)
);if(ApeFileConnection::available()){
$conCls = 'ApeFileConnection';
}elseif(ApeCurlConnection::available()){
$conCls = 'ApeCurlConnection';
}else{
die('No valid Ape-Connection availabe');
}$connection = new $conCls($APEhost, $APEport);
$client = new ApeClient($connection);
$request = new ApeRequest('inlinepush', $params);
$response = $client->sendRequest($request);
$res = $response->getResult();
if ($res->data->value == 'ok') {
echo 'Message sent !'.print_r($res, 1).'';}
else {
echo 'Error sending message, server response is :'.print_r($res, 1).'';
}
?>Other approach using ApeClient as a request gateway
dispatchRequest('inlinepush', $params);
if ($response->getResult()->data->value == 'ok') {
echo 'Message sent !'.print_r($response->getResult(), 1).'';}
else {
echo 'Error sending message, server response is :'.print_r($response->getResult(), 1).'';
}
?>