PHP Класс Horde_ActiveSync_Device, horde

Автор: Michael J Rubinsky ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_clientType string Local override/cache of detected clientType.
$_dirty array Dirty flag
$_iOSVersion string Cache of OS version.
$_multiplexSet boolean Flag to indicate self::multiplex was set externally.
$_properties array Device properties.
$_state Horde_ActiveSync_State_Base State handler

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

Метод Описание
__construct ( Horde_ActiveSync_State_Base $state, array $data = [] ) Const'r
__get ( $property ) Getter
__isset ( $property ) Magic isset
__set ( $property, $value ) Setter
enforceProvisioning ( ) : boolean Check if we should enforce provisioning on this device.
getFormattedDeviceProperties ( ) : array Return an array of DEVICEINFO data, with keys suitable for displaying.
getLastSyncTimestamp ( ) : integer Return the last time the device issued a SYNC request.
getMajorVersion ( ) : integer Return the major version number of the OS (or client app) as reported by the client.
getMinorVersion ( ) : integer Return the minor version number of the OS (or client app) as reported by the client.
hasQuirk ( integer $quirk ) : boolean Return if this client has the described quirk.
isNonProvisionable ( ) : boolean Returns if the current device is an expected non-provisionable device.
needsVersionUpdate ( string $supported ) : boolean Indicates if we need to announce new EAS version string to the client.
normalizePoomContactsDates ( Horde_Date $date, boolean $toEas = false ) : Horde_Date Return the number of hours to offset a POOMCONTACTS:BIRTHDAY or ANNIVERSARY field in an attempt to work around a bug in the protocol - which doesn't define a standard time for birthdays to occur.
save ( boolean $all = true ) Save the dirty device info data.
setDeviceProperties ( array $data ) Set the device's DEVICEINFO data.

Защищенные методы

Метод Описание
_getClientType ( ) : string Attempt to determine the *client* application as opposed to the device, which may or may not be the client.
_getIosVersion ( ) Detects the iOS version in M.m format and caches locally.
_isIos ( ) : boolean Return if this client is an iOS device. Different versions require different checks.
_isNine ( ) : boolean Helper method to sniff out the 9Folders client, "Nine".
_sniffMultiplex ( ) Basic sniffing for determining if devices can support non-multiplexed collections.

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

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

Const'r
public __construct ( Horde_ActiveSync_State_Base $state, array $data = [] )
$state Horde_ActiveSync_State_Base The state driver.
$data array The current device data.

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

Getter
public __get ( $property )

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

Magic isset
public __isset ( $property )

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

Setter
public __set ( $property, $value )

_getClientType() защищенный Метод

Attempt to determine the *client* application as opposed to the device, which may or may not be the client.
protected _getClientType ( ) : string
Результат string The client name.

_getIosVersion() защищенный Метод

Detects the iOS version in M.m format and caches locally.
protected _getIosVersion ( )

_isIos() защищенный Метод

Return if this client is an iOS device. Different versions require different checks.
protected _isIos ( ) : boolean
Результат boolean [description]

_isNine() защищенный Метод

Helper method to sniff out the 9Folders client, "Nine".
См. также: https://ninefolders.plan.io/track/7048/46b213 for the discussion on how to sniff out the Nine client. Not the best solution, but it's the one they decided to use.
protected _isNine ( ) : boolean
Результат boolean True if client is thought to be "Nine".

_sniffMultiplex() защищенный Метод

Basic sniffing for determining if devices can support non-multiplexed collections.
protected _sniffMultiplex ( )

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

Check if we should enforce provisioning on this device.
public enforceProvisioning ( ) : boolean
Результат boolean

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

Return an array of DEVICEINFO data, with keys suitable for displaying.
public getFormattedDeviceProperties ( ) : array
Результат array

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

Return the last time the device issued a SYNC request.
public getLastSyncTimestamp ( ) : integer
Результат integer The timestamp.

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

Return the major version number of the OS (or client app) as reported by the client.
public getMajorVersion ( ) : integer
Результат integer The version number.

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

Return the minor version number of the OS (or client app) as reported by the client.
public getMinorVersion ( ) : integer
Результат integer The version number.

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

Return if this client has the described quirk.
public hasQuirk ( integer $quirk ) : boolean
$quirk integer The specified quirk to check for.
Результат boolean True if quirk is present.

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

I.e., the client does not support provisioning at all, but should still be allowed to connect to a server that has provisioning set to Force. Currently, this only applies to Windows Communication Apps (Outlook 2013).
public isNonProvisionable ( ) : boolean
Результат boolean True if the device should be allowed to connect to a Forced provision server. False if not.

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

If the property is empty, we don't send it since we are sending the EAS-Version header anyway and this is a new device.
public needsVersionUpdate ( string $supported ) : boolean
$supported string The current EAS-Version header.
Результат boolean True if we need to send the MS-RP header, otherwise false.

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

WP: Devices seem to send the birthdays at the entered date, with a time of 00:00:00 UTC during standard time and with 01:00:00 UTC during DST if the client's configured timezone observes it. No idea what purpose this serves since no timezone data is transmitted for birthday values. iOS: Seems different based on version. iOS 5+, at least seems to send the birthday as midnight at the entered date in the device's timezone then converted to UTC. Some minor issues with offsets being off an hour or two for some timezones though. iOS < 5 sends the birthday time part as the time the birthday was entered/edited on the device, converted to UTC, so it can't be trusted at all. The best we can do here is transform the date to midnight on date_default_timezone() converted to UTC. Android: For contacts originating on the SERVER, the following is true: Stock 4.3 Takes the down-synched bday value which is assumed to be UTC, does some magic to it (converts to milliseconds, creates a gregorian calendar object, then converts to YYYY-MM-DD). When sending the bday value up, it sends it up as-is. No conversion to/from UTC or local is done. Stock 4.4.x does the above, but before sending the bday value, validates that it's in a correct format for sending to the server. This really only affects date data originally entered on the device for non-stock android clients. There is some strange bit of code in Android that adds 1 to the DAY_OF_MONTH when HOUR_OF_DAY >= 12 in an attempt to "fix" birthday handling for GMT+n users. See: https://android.googlesource.com/platform/packages/apps/Exchange/+/32daacdd71b9de8fd5e3f59c37934e3e4a9fa972%5E!/exchange2/src/com/android/exchange/adapter/ContactsSyncAdapter.java Not sure what to make of it, or why it's not just converted to local tz when displaying but this probably breaks birthday handling for people in a few timezones. For contacts originating on the CLIENT, the datetime is sent as 08:00:00 UTC, and this seems to be regardless of the timezone set in the Android system. Given all of this, it makes sense to me to ALWAYS send birthday data as occuring at 08:00:00 UTC for *native* Android clients. BB 10+ expects it at 11:00:00 UTC
public normalizePoomContactsDates ( Horde_Date $date, boolean $toEas = false ) : Horde_Date
$date Horde_Date The date. This should normally be in the local timezone if encoding the date for the client. If decoding the date from the client, it will normally be in UTC.
$toEas boolean Convert from local to device if true. DEFAULT: false
Результат Horde_Date The date of the birthday/anniversary, with any fixes applied for the current device. The timezone set in the object will depend on the client detected, and whether the date is being encoding or decoding.

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

Save the dirty device info data.
public save ( boolean $all = true )
$all boolean If true, save all properties (deviceInfo and deviceProperties). Otherwise, just save dirty deviceProperties. @since 2.16.0

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

Set the device's DEVICEINFO data.
public setDeviceProperties ( array $data )
$data array The data array sent from the device.

Описание свойств

$_clientType защищенное свойство

Local override/cache of detected clientType.
protected string $_clientType
Результат string

$_dirty защищенное свойство

Dirty flag
protected array $_dirty
Результат array

$_iOSVersion защищенное свойство

Cache of OS version.
protected string $_iOSVersion
Результат string

$_multiplexSet защищенное свойство

Flag to indicate self::multiplex was set externally.
protected bool $_multiplexSet
Результат boolean

$_properties защищенное свойство

Device properties.
protected array $_properties
Результат array

$_state защищенное свойство

State handler
protected Horde_ActiveSync_State_Base $_state
Результат Horde_ActiveSync_State_Base