當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PerformancePrefs::get方法代碼示例

本文整理匯總了PHP中PerformancePrefs::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP PerformancePrefs::get方法的具體用法?PHP PerformancePrefs::get怎麽用?PHP PerformancePrefs::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PerformancePrefs的用法示例。


在下文中一共展示了PerformancePrefs::get方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: executeCron

 public function executeCron($who_trigger)
 {
     $log = vglobal('log');
     $log->debug('Start executeCron');
     $row = self::getActiveScan();
     if ($row > 0) {
         $log->warn(vtranslate('ERROR_ACTIVE_CRON', 'OSSMailScanner'));
         return vtranslate('ERROR_ACTIVE_CRON', 'OSSMailScanner');
     }
     $OSSMailModel = Vtiger_Record_Model::getCleanInstance('OSSMail');
     $OSSMailScannerModel = Vtiger_Record_Model::getCleanInstance('OSSMailScanner');
     $countEmails = 0;
     $scanId = 0;
     $accounts = $OSSMailModel->getAccountsList();
     if (!$accounts) {
         $log->warn('There are no accounts to be scanned');
         return false;
     }
     self::setCronStatus('2');
     $scanId = $OSSMailScannerModel->add_scan_history(array('user' => $who_trigger));
     foreach ($OSSMailModel->getAccountsList() as $account) {
         $log->debug('Start checking account: ' . $account['username']);
         foreach ($OSSMailScannerModel->getConfigFolderList() as $key => $folders) {
             if ($folders != null) {
                 $folderArray = array();
                 if (strpos($folders, ',')) {
                     $folderArray = explode(",", $folders);
                 } else {
                     $folderArray[0] = $folders;
                 }
                 foreach ($folderArray as $folder) {
                     $log->debug('Start checking folder: ' . $folder);
                     $mbox = $OSSMailModel->imapConnect($account['username'], $account['password'], $account['mail_host'], $folder, false);
                     if (!$mbox) {
                         $log->fatal('Incorrect mail access data: ' . $account['username']);
                         continue;
                     }
                     $countEmails = $OSSMailScannerModel->mail_Scan($mbox, $account, $folder, $scanId, $countEmails);
                     imap_close($mbox);
                     if ($countEmails >= PerformancePrefs::get('NUMBERS_EMAILS_DOWNLOADED_DURING_ONE_SCANNING')) {
                         $log->warn('Reached the maximum number of scanned mails');
                         $OSSMailScannerModel->update_scan_history($scanId, ['status' => '0', 'count' => $countEmails, 'action' => 'Action_CronMailScanner']);
                         self::setCronStatus('1');
                         return 'ok';
                     }
                 }
             }
         }
     }
     $OSSMailScannerModel->update_scan_history($scanId, ['status' => '0', 'count' => $countEmails, 'action' => 'Action_CronMailScanner']);
     self::setCronStatus('1');
     $log->debug('End executeCron');
     return 'ok';
 }
開發者ID:noclav,項目名稱:UpdatePackages,代碼行數:54,代碼來源:Record.php

示例2: executeCron

 public function executeCron($who_trigger)
 {
     $row = self::getActiveScan();
     if ($row > 0) {
         return vtranslate('ERROR_ACTIVE_CRON', 'OSSMailScanner');
     }
     $OSSMailModel = Vtiger_Record_Model::getCleanInstance('OSSMail');
     $OSSMailScannerModel = Vtiger_Record_Model::getCleanInstance('OSSMailScanner');
     $countEmails = 0;
     $scanId = 0;
     $accounts = $OSSMailModel->getAccountsList();
     if (!$accounts) {
         return false;
     }
     self::setCronStatus('2');
     $scanId = $OSSMailScannerModel->add_scan_history(array('user' => $who_trigger));
     foreach ($OSSMailModel->getAccountsList() as $account) {
         foreach ($OSSMailScannerModel->getConfigFolderList() as $key => $folders) {
             if ($folders != null) {
                 $folderArray = array();
                 if (strpos($folders, ',')) {
                     $folderArray = explode(",", $folders);
                 } else {
                     $folderArray[0] = $folders;
                 }
                 foreach ($folderArray as $folder) {
                     $mbox = $OSSMailModel->imap_connect($account['username'], $account['password'], $folder);
                     $countEmails = $OSSMailScannerModel->mail_Scan($mbox, $account, $folder, $scanId, $countEmails);
                     imap_close($mbox);
                     if ($countEmails >= PerformancePrefs::get('NUMBERS_EMAILS_DOWNLOADED_DURING_ONE_SCANNING')) {
                         $OSSMailScannerModel->update_scan_history($scanId, ['status' => '0', 'count' => $countEmails, 'action' => 'Action_CronMailScanner']);
                         self::setCronStatus('1');
                         return 'ok';
                     }
                 }
             }
         }
     }
     $OSSMailScannerModel->update_scan_history($scanId, ['status' => '0', 'count' => $countEmails, 'action' => 'Action_CronMailScanner']);
     self::setCronStatus('1');
     return 'ok';
 }
開發者ID:rcrrich,項目名稱:YetiForceCRM,代碼行數:42,代碼來源:Record.php


注:本文中的PerformancePrefs::get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。