Пример #1
0
 /**
  * Вывод текущего состояния сервиса.
  * 
  * @access protected
  * @static
  */
 protected static function cmdStatus()
 {
     try {
         $pid = Assets\PID::Read();
         echo "Running with PID={$pid}\n";
         exit(0);
     } catch (Assets\Exceptions\PID_Non_Existent_Exception $e) {
         echo "Currently not running\n";
         exit(0);
     } catch (Assets\Exceptions\PID_Open_Fail_Exception $e) {
         echo "PID-file exists but unreadable\n";
         exit(1);
     } catch (Assets\Exceptions\PID_Lock_Success_Exception $e) {
         echo "PID-file exists but not locked\nDaemon tragically died\n";
         exit(1);
     } catch (Assets\Exceptions\PID_Read_Fail_Exception $e) {
         echo "PID-file reading failed!\n";
         exit(1);
     } catch (\Exception $e) {
         var_export($e->getMessage());
     }
 }