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])
파일 보기 프로젝트 열기: forkcms/forkcms 1 사용 예제들

공개 메소드들

메소드 설명
__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