示例#1
0
 /**
  * Clean logs
  *
  * @param \Magento\Log\Model\Log $object
  * @return $this
  */
 public function clean(\Magento\Log\Model\Log $object)
 {
     $cleanTime = $object->getLogCleanTime();
     $this->_cleanVisitors($cleanTime);
     $this->_cleanCustomers($cleanTime);
     $this->_cleanUrls();
     return $this;
 }
示例#2
0
 /**
  * Clean logs
  *
  * @return $this
  */
 public function logClean()
 {
     if (!$this->_scopeConfig->isSetFlag(self::XML_PATH_LOG_CLEAN_ENABLED, \Magento\Store\Model\ScopeInterface::SCOPE_STORE)) {
         return $this;
     }
     $this->_errors = array();
     try {
         $this->_log->clean();
     } catch (\Exception $e) {
         $this->_errors[] = $e->getMessage();
         $this->_errors[] = $e->getTrace();
     }
     $this->_sendLogCleanEmail();
     return $this;
 }
示例#3
0
 public function testGetOnlineMinutesInterval()
 {
     $this->scopeConfig->expects($this->once())->method('getValue')->with('customer/online_customers/online_minutes_interval', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)->will($this->returnValue(10));
     $this->assertEquals(10, $this->log->getOnlineMinutesInterval());
 }