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


PHP Operation::deleteOldOperations方法代碼示例

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


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

示例1: testDeleteOldOperations

 public function testDeleteOldOperations()
 {
     // Create 10 operations
     $i = 0;
     for ($i = 0; $i < 10; $i++) {
         $op = new Operation();
         $op->status = Operation::STATUS_SUCCEEDED;
         $op->timestamp = time();
         $op->srcid = $i;
         $op->cmdid = '1234.' . $i;
         $op->optype = Operation::OPTYPE_IMPORTPDB;
         $op->operand1 = "C:\\Program Files\\Apache Software Foundations\\htdocs\\crashfix\\protected\\data\\debugInfo\\CrashRpt{$i}.pdb";
         $op->operand2 = "C:\\Program Files\\Apache Software Foundations\\htdocs\\crashfix\\protected\runtime\tmp1234{$i}.tmp";
         $this->assertTrue($op->save());
     }
     // Delete old operations
     Operation::deleteOldOperations(5);
     // Expect there are 5 ops now
     $count = Operation::model()->count();
     $this->assertTrue($count == 5);
 }
開發者ID:xyzz,項目名稱:CrashFix,代碼行數:21,代碼來源:OperationTest.php

示例2: run

 public function run($args)
 {
     Yii::log("Entering the method run", "info");
     if (0 != $this->checkDaemonStatus()) {
         return 1;
     }
     // Delete old operations
     Operation::deleteOldOperations();
     // Look for started debug info deletion operations,check their statuses
     // and finalize completed operations.
     $this->checkDebugInfoDeletionOperations();
     // Delete debug info files marked for deletion
     $this->deletePendingDebugInfoFiles();
     // Look for started debug info import operations, check their statuses
     // and finalize completed operations.
     $this->checkDebugInfoProcessingOperations();
     // Import new debug info files uploaded recently.
     $this->processNewDebugInfoFiles();
     // Look for started crash report processing operations, check their statuses
     // and finalize completed operations.
     $this->checkCrashReportProcessingOperations();
     // Process new crash report files uploaded recently.
     $this->processNewCrashReportFiles();
     // Send pending mail messages.
     MailQueue::sendMail();
     // Perform batch import of crash report files and PDB files
     $importDir = Yii::app()->getBasePath() . "/import";
     $batchImporter = new BatchImporter();
     $importedCrashReportCount = 0;
     $importedDebugInfoCount = 0;
     $batchImporter->importFiles($importDir, $importedCrashReportCount, $importedDebugInfoCount);
     // Delete old temp files
     $this->deleteOldTempFiles();
     // Success
     Yii::log("Leaving the method run", "info");
     return 0;
 }
開發者ID:xyzz,項目名稱:CrashFix,代碼行數:37,代碼來源:PollCommand.php


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