Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# the path to document root used as static file server root
PHOO_DOCUMENT_ROOT="./public"

# the main php script that acts as the server
# this is the default implementation in modern frameworks
# like laravel, symfony, ... etc
PHOO_ENTRYPOINT="./public/server.php"

# the http listen address in the form of [address]:port
PHOO_HTTP_LISTEN_ADDR=":8000"

# whether to enable access logs or not
PHOO_ENABLE_ACCESS_LOGS=false

# the php-fpm binary filename/filepath
PHOO_PHP_FPM="php-fpm"

# the directory to store phoo internal temp files in
PHOO_DATA_DIR="./.phoo"

# php ini settings in the form of key=value
# you can pass multiple key=value pairs separated by ';'
# Example: PHOO_PHP_INI="upload_max_filesize=6M;post_max_size=30M"
PHOO_PHP_INI=""

# php fpm workers, this is the maximum requests to be served at the same time
# the default value is the machine cpus count
PHOO_WORKER_COUNT=

# php fpm max requests per worker,
# if a worker reached this number, it would be recycled
# this is helpful to guard against memory leeks.
PHOO_WORKER_MAX_REQUEST_COUNT= $PHOO_WORKER_COUNT * 100

# php fpm max request time in seconds per worker,
# if a worker reached this number, it would be terminated.
# 0 means 'Disabled'
PHOO_WORKER_MAX_REQUEST_TIME="300"

# the prometheus metrics endpoint, empty means disabled.
# default is empty (disabled)
PHOO_METRICS_PATH=

# whether to enable/disable the cors-* features/flags
PHOO_CORS_ENABLED=false

# this flag adds the specified origin to the list of allowed cors origins.
# you can pass multiple origins separated by ';'
# Example: PHOO_CORS_ORIGINS="host-name1;host-name2"
PHOO_CORS_ORIGINS="*"

# this flag adds the specified headers to the list of allowed cors headers the client can send.
# you can pass multiple origins separated by ';'
# Example: PHOO_CORS_HEADERS="header-1;header-2"
PHOO_CORS_HEADERS=""

# this flag adds the specified headers to the list of allowed headers the client can access
# you can pass multiple origins separated by ';'
# Example: PHOO_CORS_EXPOSE="header-1;header-2"
PHOO_CORS_EXPOSE=""

# this flag indicates whether or not the actual request can be made using credentials
PHOO_CORS_CREDENTIALS=false

# the cors max_age in seconds
PHOO_CORS_AGE=0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ Installation

TODOs
=====
- [ ] Add `.env.example` with comments to describe each var.
- [x] Add `.env.example` with comments to describe each var.
- [ ] Add future plans/thoughts.
6 changes: 2 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,21 @@ module github.com/alash3al/phoo
go 1.21

require (
github.com/joho/godotenv v1.5.1
github.com/labstack/echo-contrib v0.15.0
github.com/labstack/echo/v4 v4.11.1
github.com/urfave/cli/v2 v2.25.7
github.com/valyala/fasttemplate v1.2.2
github.com/yookoala/gofast v0.7.0
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/caarlos0/env/v9 v9.0.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/labstack/echo-contrib v0.15.0 // indirect
github.com/labstack/gommon v0.4.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
Expand Down
5 changes: 2 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/caarlos0/env/v9 v9.0.0 h1:SI6JNsOA+y5gj9njpgybykATIylrRMklbs5ch6wO6pc=
github.com/caarlos0/env/v9 v9.0.0/go.mod h1:ye5mlCVMYh6tZ+vCgrs/B95sj88cg5Tlnc0XIzgZ020=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
Expand All @@ -18,6 +16,8 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
Expand Down Expand Up @@ -121,7 +121,6 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/ini.v1 v1.38.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
2 changes: 2 additions & 0 deletions internals/fpm/php-fpm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ pm.max_children = {{worker.count}}
pm.max_requests = {{worker.request.max_count}}
request_terminate_timeout = {{worker.request.max_time}}
clear_env = no
user = www-data
group = www-data