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);
        }
    }
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);
        }
    }
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 ) ; } }
Redirect standard input and output.

@throws Exception
Redirect standard input and output .