public function stop()
    {
        $server = $this->createServerManager();

        // 是否已启动
        if (!$server->isRunning()) {
            \output()->writeln('<error>The server is not running! cannot stop</error>', true, true);
        }

        // pid文件
        $serverOpts = $server->getServerSetting();
        $pidFile = $serverOpts['pfile'];

        \output()->writeln(sprintf('<info>Swoft %s is stopping ...</info>', input()->getScript()));

        $result = $server->stop();

        // 停止失败
        if (!$result) {
            \output()->writeln(sprintf('<error>Swoft %s stop fail</error>', input()->getScript()), true, true);
        }
        //删除pid文件
        @unlink($pidFile);

        \output()->writeln(sprintf('<success>Swoft %s stop success!</success>', input()->getScript()));
    }
public function stop()
    {
        $server = $this->createServerManager();

        // 是否已启动
        if (!$server->isRunning()) {
            \output()->writeln('<error>The server is not running! cannot stop</error>', true, true);
        }

        // pid文件
        $serverOpts = $server->getServerSetting();
        $pidFile = $serverOpts['pfile'];

        \output()->writeln(sprintf('<info>Swoft %s is stopping ...</info>', input()->getScript()));

        $result = $server->stop();

        // 停止失败
        if (!$result) {
            \output()->writeln(sprintf('<error>Swoft %s stop fail</error>', input()->getScript()), true, true);
        }
        //删除pid文件
        @unlink($pidFile);

        \output()->writeln(sprintf('<success>Swoft %s stop success!</success>', input()->getScript()));
    }
public function stop ( ) { $ server = $ this -> createServerManager ( ) ; // 是否已启动 if ( ! $ server -> isRunning ( ) ) { \ output ( ) -> writeln ( '<error>The server is not running! cannot stop</error>' , true , true ) ; } // pid文件 $ serverOpts = $ server -> getServerSetting ( ) ; $ pidFile = $ serverOpts [ 'pfile' ] ; \ output ( ) -> writeln ( sprintf ( '<info>Swoft %s is stopping ...</info>' , input ( ) -> getScript ( ) ) ) ; $ result = $ server -> stop ( ) ; // 停止失败 if ( ! $ result ) { \ output ( ) -> writeln ( sprintf ( '<error>Swoft %s stop fail</error>' , input ( ) -> getScript ( ) ) , true , true ) ; } //删除pid文件 @ unlink ( $ pidFile ) ; \ output ( ) -> writeln ( sprintf ( '<success>Swoft %s stop success!</success>' , input ( ) -> getScript ( ) ) ) ; }
Stop the running server

@Usage {fullCommand}
@Example {fullCommand}
@throws \InvalidArgumentException
@throws \RuntimeException
Stop the running server