PHP Класс ForkAPI

This source file can be used to communicate with ForkAPI (http://api.fork-cms.be) The class is documented in the file itself. If you find any bugs help me out and report them. Reporting can be done by sending an email to php-fork-api-bugs[at]verkoyen[dot]eu. If you report a bug, make sure you give me enough information (include your code). License Copyright (c) 2010, Tijs Verkoyen. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. This software is provided by the author "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the author be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
Автор: Tijs Verkoyen ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string[optional] $publicKey = null, string[optional] $privateKey = null ) Default constructor
applePush ( mixed $deviceTokens, mixed $alert, int[optional] $badge = null, string[optional] $sound = null, array $extraDictionaries = null ) : array Push a notification to apple
appleRegisterDevice ( string $deviceToken ) : boolean Register a new/old Apple device within the Fork API
coreRequestKeys ( string $siteUrl, string $email ) : array Request public private key-pair
getTimeOut ( ) : integer Get the timeout that will be used
getUserAgent ( ) : string Get the useragent that will be used. Our version will be prepended to yours.
messagesGet ( ) : array Get messages from the server
microsoftPush ( mixed $channelUri, string $title, string[optional] $count = null, string[optional] $image = null, string[optional] $backTitle = null, string[optional] $backText = null, string[optional] $backImage = null, string[optional] $tile = null, string[optional] $uri = null ) : array Push a notification to microsoft
microsoftRegisterDevice ( string $channelUri ) : boolean Register a new/old Microsoft device within the Fork API
pingGetServices ( ) : array Get the ping services
setPrivateKey ( string $key ) : void Set the private key
setPublicKey ( string $key ) : void Set the public key
setTimeOut ( integer $seconds ) : void Set the timeout After this time the request will stop. You should handle any errors triggered by this.
setUserAgent ( string $userAgent ) : void Set the user-agent for you application It will be appended to ours, the result will look like: "PHP ForkAPI/ "
statisticsGetSearchEngines ( ) : array Get the search engines

Приватные методы

Метод Описание
doCall ( string $method, array[optional] $parameters = [], bool[optional] $authenticate = true, bool[optional] $usePOST = false ) : string Make the call
getPrivateKey ( ) : string Get the private key
getPublicKey ( ) : string Get the public key

Описание методов

__construct() публичный Метод

Default constructor
Устаревший:
public __construct ( string[optional] $publicKey = null, string[optional] $privateKey = null )
$publicKey string[optional]
$privateKey string[optional]

applePush() публичный Метод

Push a notification to apple
Устаревший: : no more support for the Fork-app.
public applePush ( mixed $deviceTokens, mixed $alert, int[optional] $badge = null, string[optional] $sound = null, array $extraDictionaries = null ) : array
$deviceTokens mixed The device token(s) for the receiver.
$alert mixed The message/dictonary to send.
$badge int[optional]
$sound string[optional]
$extraDictionaries array
Результат array The device tokens that aren't valid.

appleRegisterDevice() публичный Метод

Register a new/old Apple device within the Fork API
Устаревший: : no more support for the Fork-app.
public appleRegisterDevice ( string $deviceToken ) : boolean
$deviceToken string The device token to register.
Результат boolean

coreRequestKeys() публичный Метод

Request public private key-pair
public coreRequestKeys ( string $siteUrl, string $email ) : array
$siteUrl string The URL of the site.
$email string The e-mail adress of the site.
Результат array

getTimeOut() публичный Метод

Get the timeout that will be used
public getTimeOut ( ) : integer
Результат integer

getUserAgent() публичный Метод

It will look like: "PHP ForkAPI/ "
public getUserAgent ( ) : string
Результат string

messagesGet() публичный Метод

Get messages from the server
public messagesGet ( ) : array
Результат array

microsoftPush() публичный Метод

Push a notification to microsoft
Устаревший: : no more support for the Microsoft-app.
public microsoftPush ( mixed $channelUri, string $title, string[optional] $count = null, string[optional] $image = null, string[optional] $backTitle = null, string[optional] $backText = null, string[optional] $backImage = null, string[optional] $tile = null, string[optional] $uri = null ) : array
$channelUri mixed The channel URI(s) for the receiver.
$title string The title for the tile to send.
$count string[optional]
$image string[optional]
$backTitle string[optional]
$backText string[optional]
$backImage string[optional]
$tile string[optional]
$uri string[optional]
Результат array The device tokens that aren't valid.

microsoftRegisterDevice() публичный Метод

Register a new/old Microsoft device within the Fork API
Устаревший: : no more support for the Microsoft-app.
public microsoftRegisterDevice ( string $channelUri ) : boolean
$channelUri string The channel uri to register.
Результат boolean

pingGetServices() публичный Метод

Get the ping services
Устаревший:
public pingGetServices ( ) : array
Результат array

setPrivateKey() публичный Метод

Set the private key
Устаревший:
public setPrivateKey ( string $key ) : void
$key string The private key.
Результат void

setPublicKey() публичный Метод

Set the public key
Устаревший:
public setPublicKey ( string $key ) : void
$key string The public key.
Результат void

setTimeOut() публичный Метод

Set the timeout After this time the request will stop. You should handle any errors triggered by this.
public setTimeOut ( integer $seconds ) : void
$seconds integer The timeout in seconds.
Результат void

setUserAgent() публичный Метод

Set the user-agent for you application It will be appended to ours, the result will look like: "PHP ForkAPI/ "
public setUserAgent ( string $userAgent ) : void
$userAgent string Your user-agent, it should look like /.
Результат void

statisticsGetSearchEngines() публичный Метод

Get the search engines
public statisticsGetSearchEngines ( ) : array
Результат array