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