本文整理汇总了PHP中ZLog::GetLastMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP ZLog::GetLastMessage方法的具体用法?PHP ZLog::GetLastMessage怎么用?PHP ZLog::GetLastMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZLog
的用法示例。
在下文中一共展示了ZLog::GetLastMessage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ResyncDevice
/**
* Marks a a device of the Request::GetGETUser() for resynchronization
*
* @param string $deviceId the device id
*
* @access public
* @return boolean
* @throws SoapFault
*/
public function ResyncDevice($deviceId)
{
$deviceId = preg_replace("/[^A-Za-z0-9]/", "", $deviceId);
ZLog::Write(LOGLEVEL_INFO, sprintf("WebserviceDevice::ResyncDevice('%s'): mark device of user '%s' for resynchronization", $deviceId, Request::GetGETUser()));
if (!ZPushAdmin::ResyncDevice(Request::GetGETUser(), $deviceId)) {
ZPush::GetTopCollector()->AnnounceInformation(ZLog::GetLastMessage(LOGLEVEL_ERROR), true);
throw new SoapFault("ERROR", ZLog::GetLastMessage(LOGLEVEL_ERROR));
}
ZPush::GetTopCollector()->AnnounceInformation(sprintf("Resync requested - device id '%s'", $deviceId), true);
return true;
}
示例2: printDeviceData
/**
* Prints detailed informations about a device
*
* @param string $deviceId the id of the device
* @param string $user the user
*
* @return
* @access private
*/
private static function printDeviceData($deviceId, $user)
{
$device = ZPushAdmin::GetDeviceDetails($deviceId, $user);
if (!$device instanceof ASDevice) {
echo sprintf("Folder resync failed: %s\n", ZLog::GetLastMessage(LOGLEVEL_ERROR));
return false;
}
// Gather some statistics about synchronized folders
$folders = $device->GetAllFolderIds();
$synchedFolders = 0;
$synchedFolderTypes = array();
$syncedFoldersInProgress = 0;
foreach ($folders as $folderid) {
if ($device->GetFolderUUID($folderid)) {
$synchedFolders++;
$type = $device->GetFolderType($folderid);
switch ($type) {
case SYNC_FOLDER_TYPE_APPOINTMENT:
case SYNC_FOLDER_TYPE_USER_APPOINTMENT:
$gentype = "Calendars";
break;
case SYNC_FOLDER_TYPE_CONTACT:
case SYNC_FOLDER_TYPE_USER_CONTACT:
$gentype = "Contacts";
break;
case SYNC_FOLDER_TYPE_TASK:
case SYNC_FOLDER_TYPE_USER_TASK:
$gentype = "Tasks";
break;
case SYNC_FOLDER_TYPE_NOTE:
case SYNC_FOLDER_TYPE_USER_NOTE:
$gentype = "Notes";
break;
default:
$gentype = "Emails";
break;
}
if (!isset($synchedFolderTypes[$gentype])) {
$synchedFolderTypes[$gentype] = 0;
}
$synchedFolderTypes[$gentype]++;
// set the folder name for all folders which are not fully synchronized yet
$fstatus = $device->GetFolderSyncStatus($folderid);
if ($fstatus !== false && is_array($fstatus)) {
// TODO would be nice if we could see the real name of the folder, right now we use the folder type as name
$fstatus['name'] = $gentype;
$device->SetFolderSyncStatus($folderid, $fstatus);
$syncedFoldersInProgress++;
}
}
}
$folderinfo = "";
foreach ($synchedFolderTypes as $gentype => $count) {
$folderinfo .= $gentype;
if ($count > 1) {
$folderinfo .= "({$count})";
}
$folderinfo .= " ";
}
if (!$folderinfo) {
$folderinfo = "None available";
}
echo "-----------------------------------------------------\n";
echo "DeviceId:\t\t{$deviceId}\n";
echo "Device type:\t\t" . ($device->GetDeviceType() !== ASDevice::UNDEFINED ? $device->GetDeviceType() : "unknown") . "\n";
echo "UserAgent:\t\t" . ($device->GetDeviceUserAgent() !== ASDevice::UNDEFINED ? $device->GetDeviceUserAgent() : "unknown") . "\n";
// TODO implement $device->GetDeviceUserAgentHistory()
// device information transmitted during Settings command
if ($device->GetDeviceModel()) {
echo "Device Model:\t\t" . $device->GetDeviceModel() . "\n";
}
if ($device->GetDeviceIMEI()) {
echo "Device IMEI:\t\t" . $device->GetDeviceIMEI() . "\n";
}
if ($device->GetDeviceFriendlyName()) {
echo "Device friendly name:\t" . $device->GetDeviceFriendlyName() . "\n";
}
if ($device->GetDeviceOS()) {
echo "Device OS:\t\t" . $device->GetDeviceOS() . "\n";
}
if ($device->GetDeviceOSLanguage()) {
echo "Device OS Language:\t" . $device->GetDeviceOSLanguage() . "\n";
}
if ($device->GetDevicePhoneNumber()) {
echo "Device Phone nr:\t" . $device->GetDevicePhoneNumber() . "\n";
}
if ($device->GetDeviceMobileOperator()) {
echo "Device Operator:\t" . $device->GetDeviceMobileOperator() . "\n";
}
if ($device->GetDeviceEnableOutboundSMS()) {
echo "Device Outbound SMS:\t" . $device->GetDeviceEnableOutboundSMS() . "\n";
//.........这里部分代码省略.........
示例3: AnnounceIgnoredMessage
/**
* Called when a SyncObject is not being streamed to the mobile.
* The user can be informed so he knows about this issue
*
* @param string $folderid id of the parent folder (may be false if unknown)
* @param string $id message id
* @param SyncObject $message the broken message
* @param string $reason (self::MSG_BROKEN_UNKNOWN, self::MSG_BROKEN_CAUSINGLOOP, self::MSG_BROKEN_SEMANTICERR)
*
* @access public
* @return boolean
*/
public function AnnounceIgnoredMessage($folderid, $id, SyncObject $message, $reason = self::MSG_BROKEN_UNKNOWN)
{
if ($folderid === false) {
$folderid = $this->getLatestFolder();
}
$class = get_class($message);
$brokenMessage = new StateObject();
$brokenMessage->id = $id;
$brokenMessage->folderid = $folderid;
$brokenMessage->ASClass = $class;
$brokenMessage->folderid = $folderid;
$brokenMessage->reasonCode = $reason;
$brokenMessage->reasonString = 'unknown cause';
$brokenMessage->timestamp = time();
$brokenMessage->asobject = $message;
$brokenMessage->reasonString = ZLog::GetLastMessage(LOGLEVEL_WARN);
$this->device->AddIgnoredMessage($brokenMessage);
ZLog::Write(LOGLEVEL_ERROR, sprintf("Ignored broken message (%s). Reason: '%s' Folderid: '%s' message id '%s'", $class, $reason, $folderid, $id));
return true;
}
示例4: CommandClearLoopDetectionData
public static function CommandClearLoopDetectionData()
{
$stat = false;
$stat = ZPushAdmin::ClearLoopDetectionData(self::$user, self::$device);
if (self::$user === false && self::$device === false) {
echo sprintf("System wide loop detection data removed: %s", $stat ? 'OK' : ZLog::GetLastMessage(LOGLEVEL_ERROR)) . "\n";
} elseif (self::$user === false) {
echo sprintf("Loop detection data of device '%s' removed: %s", self::$device, $stat ? 'OK' : ZLog::GetLastMessage(LOGLEVEL_ERROR)) . "\n";
} elseif (self::$device === false && self::$user !== false) {
echo sprintf("Error: %s", $stat ? 'OK' : ZLog::GetLastMessage(LOGLEVEL_WARN)) . "\n";
} else {
echo sprintf("Loop detection data of device '%s' of user '%s' removed: %s", self::$device, self::$user, $stat ? 'OK' : ZLog::GetLastMessage(LOGLEVEL_ERROR)) . "\n";
}
}
示例5: AdditionalFolderRemove
/**
* Removes an additional folder from the given device and the Request::GetGETUser().
*
* @param string $deviceId device id of where the folder should be removed.
* @param string $add_folderid the folder id of the additional folder.
*
* @access public
* @return boolean
*/
public function AdditionalFolderRemove($deviceId, $add_folderid)
{
$user = Request::GetGETUser();
$deviceId = preg_replace("/[^A-Za-z0-9]/", "", $deviceId);
$add_folderid = preg_replace("/[^A-Za-z0-9]/", "", $add_folderid);
$status = ZPushAdmin::AdditionalFolderRemove($user, $deviceId, $add_folderid);
if (!$status) {
ZPush::GetTopCollector()->AnnounceInformation(ZLog::GetLastMessage(LOGLEVEL_ERROR), true);
throw new SoapFault("ERROR", ZLog::GetLastMessage(LOGLEVEL_ERROR));
}
ZLog::Write(LOGLEVEL_INFO, sprintf("WebserviceDevice::AdditionalFolderRemove(): removed folder for device '%s' of user '%s': %s", $deviceId, $user, Utils::PrintAsString($status)));
ZPush::GetTopCollector()->AnnounceInformation("Removed additional folder", true);
return $status;
}