productMetaData = $productMetadata; $this->scheduleFactory = $scheduleFactory; $this->dateTime = $datetime; } /** * @return string */ public function getCurrentServerUser() { return get_current_user(); } /** * @return string */ public function getCurrentServerUserGroup() { if (function_exists('posix_getegid')) { $groupid = posix_getegid(); $groupinfo = posix_getgrgid($groupid); if (is_array($groupinfo)) { return $groupinfo['name']; } } return '-'; } /** * @return string */ public function getMagentoEdition() { return $this->productMetaData->getEdition() . ' ( ' . $this->productMetaData->getVersion() . ' )'; } /** * @param int $pageSize * @return \Magento\Cron\Model\ResourceModel\Schedule\Collection mixed */ public function getLatestCronJobs($pageSize) { $scheduleCollection = $this->scheduleFactory->create()->getCollection(); $scheduleCollection->setOrder('schedule_id', 'DESC') ->setPageSize($pageSize); return $scheduleCollection; } /** * @return string */ public function getServerTime() { return $this->dateTime->gmtDate(); } }