当前位置: 首页>>代码示例>>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;未经允许,请勿转载。