original_string: public static function resetStd()
      {
          if (!static::$daemonize || static::$_OS !== OS_TYPE_LINUX) {
              return;
          }
          global $STDOUT, $STDERR;
          $handle = fopen(static::$stdoutFile, "a");
          if ($handle) {
              unset($handle);
              set_error_handler(function(){});
              fclose($STDOUT);
              fclose($STDERR);
              fclose(STDOUT);
              fclose(STDERR);
              $STDOUT = fopen(static::$stdoutFile, "a");
              $STDERR = fopen(static::$stdoutFile, "a");
              // change output stream
              static::$_outputStream = null;
              static::outputStream($STDOUT);
              restore_error_handler();
          } else {
              throw new Exception('can not open stdoutFile ' . static::$stdoutFile);
          }
      }
code: public static function resetStd()
      {
          if (!static::$daemonize || static::$_OS !== OS_TYPE_LINUX) {
              return;
          }
          global $STDOUT, $STDERR;
          $handle = fopen(static::$stdoutFile, "a");
          if ($handle) {
              unset($handle);
              set_error_handler(function(){});
              fclose($STDOUT);
              fclose($STDERR);
              fclose(STDOUT);
              fclose(STDERR);
              $STDOUT = fopen(static::$stdoutFile, "a");
              $STDERR = fopen(static::$stdoutFile, "a");
              // change output stream
              static::$_outputStream = null;
              static::outputStream($STDOUT);
              restore_error_handler();
          } else {
              throw new Exception('can not open stdoutFile ' . static::$stdoutFile);
          }
      }
code_tokens: public static function resetStd ( ) { if ( ! static :: $ daemonize || static :: $ _OS !== OS_TYPE_LINUX ) { return ; } global $ STDOUT , $ STDERR ; $ handle = fopen ( static :: $ stdoutFile , "a" ) ; if ( $ handle ) { unset ( $ handle ) ; set_error_handler ( function ( ) { } ) ; fclose ( $ STDOUT ) ; fclose ( $ STDERR ) ; fclose ( STDOUT ) ; fclose ( STDERR ) ; $ STDOUT = fopen ( static :: $ stdoutFile , "a" ) ; $ STDERR = fopen ( static :: $ stdoutFile , "a" ) ; // change output stream static :: $ _outputStream = null ; static :: outputStream ( $ STDOUT ) ; restore_error_handler ( ) ; } else { throw new Exception ( 'can not open stdoutFile ' . static :: $ stdoutFile ) ; } }
docstring: Redirect standard input and output.
  
  @throws Exception
docstring_tokens: Redirect standard input and output .