summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-07-26 16:32:27 +0300
committerWolfy-J <[email protected]>2018-07-26 16:32:27 +0300
commitbcef5b36bb50b2fecd4db4ca8e01640347300bea (patch)
treeb6db6954063dd3288a80f24aa714e8799664d909 /cmd
parent0f8e2bab6888f1b27ed2bd1b91ac6b2677f03450 (diff)
- added support for custom env provider
- new config section "env" to share env variables with php process - container can resolve interfaces now
Diffstat (limited to 'cmd')
-rw-r--r--cmd/rr/.rr.yaml4
-rw-r--r--cmd/rr/main.go8
2 files changed, 9 insertions, 3 deletions
diff --git a/cmd/rr/.rr.yaml b/cmd/rr/.rr.yaml
index 5ea6b345..401a42da 100644
--- a/cmd/rr/.rr.yaml
+++ b/cmd/rr/.rr.yaml
@@ -1,3 +1,7 @@
+# defines environment variables for all underlying php processes
+env:
+ key: value
+
# rpc bus allows php application and external clients to talk to rr services.
rpc:
# enable rpc server
diff --git a/cmd/rr/main.go b/cmd/rr/main.go
index 2a16b195..2abb6321 100644
--- a/cmd/rr/main.go
+++ b/cmd/rr/main.go
@@ -23,8 +23,6 @@
package main
import (
- "github.com/sirupsen/logrus"
-
rr "github.com/spiral/roadrunner/cmd/rr/cmd"
// services (plugins)
@@ -33,15 +31,19 @@ import (
"github.com/spiral/roadrunner/service/static"
// additional command handlers
+ "github.com/sirupsen/logrus"
_ "github.com/spiral/roadrunner/cmd/rr/http"
+ "github.com/spiral/roadrunner/service/env"
)
func main() {
+ rr.Logger.Formatter = &logrus.TextFormatter{ForceColors: true}
+
+ rr.Container.Register(env.ID, &env.Service{})
rr.Container.Register(rpc.ID, &rpc.Service{})
rr.Container.Register(http.ID, &http.Service{})
rr.Container.Register(static.ID, &static.Service{})
// you can register additional commands using cmd.CLI
- rr.Logger.Formatter = &logrus.TextFormatter{ForceColors: true}
rr.Execute()
}