예제 #1
0
 protected function systemStatus()
 {
     $ret = NSDR2::systemStatus();
     if ($ret === false) {
         $ret = __("Stop");
     }
     return $ret;
 }
예제 #2
0
 public static function getServices()
 {
     $ok = true;
     $services = array();
     $service = array();
     $id = 'nsdr';
     $service['id'] = $id;
     $service['name'] = 'NSDR';
     $nsdrStatus = NSDR2::systemStatus();
     if ($nsdrStatus === false) {
         $ok = false;
         $nsdrStatus = 'stopped';
     }
     if ($nsdrStatus != 'started' && $nsdrStatus != 'reloaded') {
         $ok = false;
     }
     $service['status'] = ucwords($nsdrStatus);
     $services[$id] = $service;
     $service = array();
     $id = 'hl7d';
     $service['id'] = $id;
     $service['name'] = 'Processing Daemon';
     $hl7Status = false;
     // temporarily set to false
     if ($hl7Status === false) {
         $hl7Status = 'stopped';
     }
     $hl7Status = 'Stopped';
     if (file_exists('/tmp/CHProcessingDaemon.lock')) {
         $hl7Status = 'Started';
     }
     $service['status'] = ucwords($hl7Status);
     $services[$id] = $service;
     $service = array();
     $id = 'menu';
     $service['id'] = $id;
     $service['name'] = 'Menu';
     $configItem = new ConfigItem();
     $configItem->configId = 'enableCache';
     $configItem->populate();
     $menuStatus = __('Disable');
     if ($configItem->value) {
         $menuStatus = __('Enable');
     } else {
         $ok = false;
     }
     $service['status'] = $menuStatus;
     $services[$id] = $service;
     $service = array();
     $id = 'permissions';
     $service['id'] = $id;
     $service['name'] = 'Permissions';
     $status = PermissionTemplate::serviceStatus();
     if ($status === false) {
         $ok = false;
         $status = 'stopped';
     }
     if ($status != 'started' && $status != 'reloaded') {
         $ok = false;
     }
     $service['status'] = ucwords($status);
     $services[$id] = $service;
     $memcache = Zend_Registry::get('memcache');
     $serviceNominal = $memcache->get(self::SERVICE_NOMINAL);
     if ($ok) {
         $memcache = Zend_Registry::get('memcache');
         $memcache->set(self::SERVICE_NOMINAL, true);
     } else {
         if ($serviceNominal !== false) {
             $memcache->delete(self::SERVICE_NOMINAL, 0);
         }
     }
     return $services;
 }