Skip to content

Commit

Permalink
run in-proc server
Browse files Browse the repository at this point in the history
  • Loading branch information
withinboredom committed Mar 14, 2024
1 parent a9726a8 commit 2afb50c
Show file tree
Hide file tree
Showing 426 changed files with 19 additions and 148,039 deletions.
Binary file modified bin/dphp-linux-x86_64
Binary file not shown.
1 change: 0 additions & 1 deletion cli/.vendor_modified

This file was deleted.

17 changes: 16 additions & 1 deletion cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import (
"encoding/json"
"fmt"
"github.com/dunglas/frankenphp"
"github.com/nats-io/nats-server/v2/server"
"github.com/nats-io/nats-server/v2/test"
"github.com/nats-io/nats.go"
"github.com/nats-io/nats.go/jetstream"
"github.com/teris-io/cli"
Expand Down Expand Up @@ -80,11 +82,24 @@ func findBootstrap(options map[string]string, logger *zap.Logger) string {
func execute(args []string, options map[string]string) int {
logger := getLogger(options)

nurl := nats.DefaultURL
nurl := ""
if options["nats-server"] == "" {
nurl = options["nats-server"]
}

if nurl == "" {
s := test.RunServer(&server.Options{
Host: "localhost",
Port: 4222,
NoLog: true,
NoSigs: true,
JetStream: true,
MaxControlLine: 2048,
})
defer s.Shutdown()
nurl = nats.DefaultURL
}

nopts := []nats.Option{
nats.Compression(true),
nats.RetryOnFailedConnect(true),
Expand Down
2 changes: 2 additions & 0 deletions cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ require github.com/dunglas/frankenphp v1.1.1-0.20240313210106-6a3db9429dca

require github.com/nats-io/nats.go v1.33.1

require github.com/nats-io/nats-server/v2 v2.10.12

require github.com/teris-io/cli v1.0.1

require go.uber.org/zap v1.27.0
Expand Down
1 change: 1 addition & 0 deletions cli/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLA
github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
github.com/maypok86/otter v1.2.0 h1:djwBBNpp9+dyzBTY0zscIG+pyAQVXRRRMbzztf8iJ4U=
github.com/maypok86/otter v1.2.0/go.mod h1:mKLfoI7v1HOmQMwFgX4QkRk23mX6ge3RDvjdHOWG4R4=
github.com/nats-io/nats-server/v2 v2.10.12/go.mod h1:H1n6zXtYLFCgXcf/SF8QNTSIFuS8tyZQMN9NguUHdEs=
github.com/nats-io/nats.go v1.33.1 h1:8TxLZZ/seeEfR97qV0/Bl939tpDnt2Z2fK3HkPypj70=
github.com/nats-io/nats.go v1.33.1/go.mod h1:Ubdu4Nh9exXdSz0RVWRFBbRfrbSxOYd26oF0wkWclB8=
github.com/nats-io/nkeys v0.4.7 h1:RwNJbbIdYCoClSDNY7QVKZlyb/wfT6ugvFCiKy6vDvI=
Expand Down
2 changes: 0 additions & 2 deletions cli/vendor/github.com/dolthub/maphash/.gitignore

This file was deleted.

201 changes: 0 additions & 201 deletions cli/vendor/github.com/dolthub/maphash/LICENSE

This file was deleted.

4 changes: 0 additions & 4 deletions cli/vendor/github.com/dolthub/maphash/README.md

This file was deleted.

48 changes: 0 additions & 48 deletions cli/vendor/github.com/dolthub/maphash/hasher.go

This file was deleted.

Loading

0 comments on commit 2afb50c

Please sign in to comment.