Skip to content

Commit 7378d85

Browse files
committed
chore: initial config
1 parent 0b620fa commit 7378d85

File tree

4 files changed

+342
-0
lines changed

4 files changed

+342
-0
lines changed

Diff for: .ddev/config.yaml

+276
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,276 @@
1+
name: php-api-sdk
2+
type: php
3+
docroot: ""
4+
php_version: "8.1"
5+
webserver_type: nginx-fpm
6+
xdebug_enabled: false
7+
additional_hostnames: []
8+
additional_fqdns: []
9+
database:
10+
type: mariadb
11+
version: "10.4"
12+
omit_containers: [db]
13+
use_dns_when_possible: true
14+
composer_version: "2"
15+
web_environment: []
16+
17+
# Key features of DDEV's config.yaml:
18+
19+
# name: <projectname> # Name of the project, automatically provides
20+
# http://projectname.ddev.site and https://projectname.ddev.site
21+
22+
# type: <projecttype> # backdrop, craftcms, django4, drupal6/7/8/9/10, laravel, magento, magento2, php, python, shopware6, silverstripe, typo3, wordpress
23+
# See https://ddev.readthedocs.io/en/latest/users/quickstart/ for more
24+
# information on the different project types
25+
26+
# docroot: <relative_path> # Relative path to the directory containing index.php.
27+
28+
# php_version: "8.1" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"
29+
30+
# You can explicitly specify the webimage but this
31+
# is not recommended, as the images are often closely tied to DDEV's' behavior,
32+
# so this can break upgrades.
33+
34+
# webimage: <docker_image> # nginx/php docker image.
35+
36+
# database:
37+
# type: <dbtype> # mysql, mariadb, postgres
38+
# version: <version> # database version, like "10.4" or "8.0"
39+
# MariaDB versions can be 5.5-10.8 and 10.11, MySQL versions can be 5.5-8.0
40+
# PostgreSQL versions can be 9-16.
41+
42+
# router_http_port: <port> # Port to be used for http (defaults to global configuration, usually 80)
43+
# router_https_port: <port> # Port for https (defaults to global configuration, usually 443)
44+
45+
# xdebug_enabled: false # Set to true to enable Xdebug and "ddev start" or "ddev restart"
46+
# Note that for most people the commands
47+
# "ddev xdebug" to enable Xdebug and "ddev xdebug off" to disable it work better,
48+
# as leaving Xdebug enabled all the time is a big performance hit.
49+
50+
# xhprof_enabled: false # Set to true to enable Xhprof and "ddev start" or "ddev restart"
51+
# Note that for most people the commands
52+
# "ddev xhprof" to enable Xhprof and "ddev xhprof off" to disable it work better,
53+
# as leaving Xhprof enabled all the time is a big performance hit.
54+
55+
# webserver_type: nginx-fpm, apache-fpm, or nginx-gunicorn
56+
57+
# timezone: Europe/Berlin
58+
# This is the timezone used in the containers and by PHP;
59+
# it can be set to any valid timezone,
60+
# see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
61+
# For example Europe/Dublin or MST7MDT
62+
63+
# composer_root: <relative_path>
64+
# Relative path to the Composer root directory from the project root. This is
65+
# the directory which contains the composer.json and where all Composer related
66+
# commands are executed.
67+
68+
# composer_version: "2"
69+
# You can set it to "" or "2" (default) for Composer v2 or "1" for Composer v1
70+
# to use the latest major version available at the time your container is built.
71+
# It is also possible to use each other Composer version channel. This includes:
72+
# - 2.2 (latest Composer LTS version)
73+
# - stable
74+
# - preview
75+
# - snapshot
76+
# Alternatively, an explicit Composer version may be specified, for example "2.2.18".
77+
# To reinstall Composer after the image was built, run "ddev debug refresh".
78+
79+
# nodejs_version: "18"
80+
# change from the default system Node.js version to any other version.
81+
# Numeric version numbers can be complete (i.e. 18.15.0) or
82+
# incomplete (18, 17.2, 16). 'lts' and 'latest' can be used as well along with
83+
# other named releases.
84+
# see https://www.npmjs.com/package/n#specifying-nodejs-versions
85+
# Note that you can continue using 'ddev nvm' or nvm inside the web container
86+
# to change the project's installed node version if you need to.
87+
88+
# additional_hostnames:
89+
# - somename
90+
# - someothername
91+
# would provide http and https URLs for "somename.ddev.site"
92+
# and "someothername.ddev.site".
93+
94+
# additional_fqdns:
95+
# - example.com
96+
# - sub1.example.com
97+
# would provide http and https URLs for "example.com" and "sub1.example.com"
98+
# Please take care with this because it can cause great confusion.
99+
100+
# upload_dirs: "custom/upload/dir"
101+
#
102+
# upload_dirs:
103+
# - custom/upload/dir
104+
# - ../private
105+
#
106+
# would set the destination paths for ddev import-files to <docroot>/custom/upload/dir
107+
# When Mutagen is enabled this path is bind-mounted so that all the files
108+
# in the upload_dirs don't have to be synced into Mutagen.
109+
110+
# disable_upload_dirs_warning: false
111+
# If true, turns off the normal warning that says
112+
# "You have Mutagen enabled and your 'php' project type doesn't have upload_dirs set"
113+
114+
# ddev_version_constraint: ""
115+
# Example:
116+
# ddev_version_constraint: ">= 1.22.4"
117+
# This will enforce that the running ddev version is within this constraint.
118+
# See https://github.com/Masterminds/semver#checking-version-constraints for
119+
# supported constraint formats
120+
121+
# working_dir:
122+
# web: /var/www/html
123+
# db: /home
124+
# would set the default working directory for the web and db services.
125+
# These values specify the destination directory for ddev ssh and the
126+
# directory in which commands passed into ddev exec are run.
127+
128+
# omit_containers: [db, ddev-ssh-agent]
129+
# Currently only these containers are supported. Some containers can also be
130+
# omitted globally in the ~/.ddev/global_config.yaml. Note that if you omit
131+
# the "db" container, several standard features of DDEV that access the
132+
# database container will be unusable. In the global configuration it is also
133+
# possible to omit ddev-router, but not here.
134+
135+
# performance_mode: "global"
136+
# DDEV offers performance optimization strategies to improve the filesystem
137+
# performance depending on your host system. Should be configured globally.
138+
#
139+
# If set, will override the global config. Possible values are:
140+
# - "global": uses the value from the global config.
141+
# - "none": disables performance optimization for this project.
142+
# - "mutagen": enables Mutagen for this project.
143+
# - "nfs": enables NFS for this project.
144+
#
145+
# See https://ddev.readthedocs.io/en/latest/users/install/performance/#nfs
146+
# See https://ddev.readthedocs.io/en/latest/users/install/performance/#mutagen
147+
148+
# fail_on_hook_fail: False
149+
# Decide whether 'ddev start' should be interrupted by a failing hook
150+
151+
# host_https_port: "59002"
152+
# The host port binding for https can be explicitly specified. It is
153+
# dynamic unless otherwise specified.
154+
# This is not used by most people, most people use the *router* instead
155+
# of the localhost port.
156+
157+
# host_webserver_port: "59001"
158+
# The host port binding for the ddev-webserver can be explicitly specified. It is
159+
# dynamic unless otherwise specified.
160+
# This is not used by most people, most people use the *router* instead
161+
# of the localhost port.
162+
163+
# host_db_port: "59002"
164+
# The host port binding for the ddev-dbserver can be explicitly specified. It is dynamic
165+
# unless explicitly specified.
166+
167+
# mailpit_http_port: "8025"
168+
# mailpit_https_port: "8026"
169+
# The Mailpit ports can be changed from the default 8025 and 8026
170+
171+
# host_mailpit_port: "8025"
172+
# The mailpit port is not normally bound on the host at all, instead being routed
173+
# through ddev-router, but it can be bound directly to localhost if specified here.
174+
175+
# webimage_extra_packages: [php7.4-tidy, php-bcmath]
176+
# Extra Debian packages that are needed in the webimage can be added here
177+
178+
# dbimage_extra_packages: [telnet,netcat]
179+
# Extra Debian packages that are needed in the dbimage can be added here
180+
181+
# use_dns_when_possible: true
182+
# If the host has internet access and the domain configured can
183+
# successfully be looked up, DNS will be used for hostname resolution
184+
# instead of editing /etc/hosts
185+
# Defaults to true
186+
187+
# project_tld: ddev.site
188+
# The top-level domain used for project URLs
189+
# The default "ddev.site" allows DNS lookup via a wildcard
190+
# If you prefer you can change this to "ddev.local" to preserve
191+
# pre-v1.9 behavior.
192+
193+
# ngrok_args: --basic-auth username:pass1234
194+
# Provide extra flags to the "ngrok http" command, see
195+
# https://ngrok.com/docs/ngrok-agent/config or run "ngrok http -h"
196+
197+
# disable_settings_management: false
198+
# If true, DDEV will not create CMS-specific settings files like
199+
# Drupal's settings.php/settings.ddev.php or TYPO3's AdditionalConfiguration.php
200+
# In this case the user must provide all such settings.
201+
202+
# You can inject environment variables into the web container with:
203+
# web_environment:
204+
# - SOMEENV=somevalue
205+
# - SOMEOTHERENV=someothervalue
206+
207+
# no_project_mount: false
208+
# (Experimental) If true, DDEV will not mount the project into the web container;
209+
# the user is responsible for mounting it manually or via a script.
210+
# This is to enable experimentation with alternate file mounting strategies.
211+
# For advanced users only!
212+
213+
# bind_all_interfaces: false
214+
# If true, host ports will be bound on all network interfaces,
215+
# not the localhost interface only. This means that ports
216+
# will be available on the local network if the host firewall
217+
# allows it.
218+
219+
# default_container_timeout: 120
220+
# The default time that DDEV waits for all containers to become ready can be increased from
221+
# the default 120. This helps in importing huge databases, for example.
222+
223+
#web_extra_exposed_ports:
224+
#- name: nodejs
225+
# container_port: 3000
226+
# http_port: 2999
227+
# https_port: 3000
228+
#- name: something
229+
# container_port: 4000
230+
# https_port: 4000
231+
# http_port: 3999
232+
# Allows a set of extra ports to be exposed via ddev-router
233+
# Fill in all three fields even if you don’t intend to use the https_port!
234+
# If you don’t add https_port, then it defaults to 0 and ddev-router will fail to start.
235+
#
236+
# The port behavior on the ddev-webserver must be arranged separately, for example
237+
# using web_extra_daemons.
238+
# For example, with a web app on port 3000 inside the container, this config would
239+
# expose that web app on https://<project>.ddev.site:9999 and http://<project>.ddev.site:9998
240+
# web_extra_exposed_ports:
241+
# - name: myapp
242+
# container_port: 3000
243+
# http_port: 9998
244+
# https_port: 9999
245+
246+
#web_extra_daemons:
247+
#- name: "http-1"
248+
# command: "/var/www/html/node_modules/.bin/http-server -p 3000"
249+
# directory: /var/www/html
250+
#- name: "http-2"
251+
# command: "/var/www/html/node_modules/.bin/http-server /var/www/html/sub -p 3000"
252+
# directory: /var/www/html
253+
254+
# override_config: false
255+
# By default, config.*.yaml files are *merged* into the configuration
256+
# But this means that some things can't be overridden
257+
# For example, if you have 'use_dns_when_possible: true'' you can't override it with a merge
258+
# and you can't erase existing hooks or all environment variables.
259+
# However, with "override_config: true" in a particular config.*.yaml file,
260+
# 'use_dns_when_possible: false' can override the existing values, and
261+
# hooks:
262+
# post-start: []
263+
# or
264+
# web_environment: []
265+
# or
266+
# additional_hostnames: []
267+
# can have their intended affect. 'override_config' affects only behavior of the
268+
# config.*.yaml file it exists in.
269+
270+
# Many DDEV commands can be extended to run tasks before or after the
271+
# DDEV command is executed, for example "post-start", "post-import-db",
272+
# "pre-composer", "post-composer"
273+
# See https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/ for more
274+
# information on the commands that can be extended and the tasks you can define
275+
# for them. Example:
276+
#hooks:

Diff for: .gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/composer.lock
2+
/composer.phar
3+
/phpunit.xml
4+
/.phpunit.result.cache
5+
/vendor/
6+
/logs/
7+
/.idea
8+
/index.php

Diff for: composer.json

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "programmatordev/php-api-sdk",
3+
"description": "",
4+
"type": "library",
5+
"keywords": [],
6+
"license": "MIT",
7+
"authors": [
8+
{
9+
"name": "André Pimpão",
10+
"email": "[email protected]",
11+
"homepage": "https://programmator.dev/"
12+
}
13+
],
14+
"require": {
15+
"php": ">=8.1"
16+
},
17+
"require-dev": {
18+
"phpunit/phpunit": "^10.0",
19+
"symfony/var-dumper": "^6.4"
20+
},
21+
"autoload": {
22+
"psr-4": {
23+
"ProgrammatorDev\\PhpApiSdk\\": "src/"
24+
}
25+
},
26+
"autoload-dev": {
27+
"psr-4": {
28+
"ProgrammatorDev\\PhpApiSdk\\Test\\": "tests/"
29+
}
30+
},
31+
"config": {
32+
"optimize-autoloader": true,
33+
"sort-packages": true
34+
}
35+
}

Diff for: phpunit.xml.dist

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5+
colors="true"
6+
bootstrap="vendor/autoload.php"
7+
stopOnError="true"
8+
>
9+
<php>
10+
<ini name="memory_limit" value="-1" />
11+
<ini name="error_reporting" value="-1" />
12+
<ini name="log_errors_max_len" value="0" />
13+
<ini name="zend.assertions" value="1" />
14+
<ini name="assert.exception" value="1" />
15+
<ini name="xdebug.show_exception_trace" value="0" />
16+
</php>
17+
18+
<testsuites>
19+
<testsuite name="Project Test Suite">
20+
<directory>tests</directory>
21+
</testsuite>
22+
</testsuites>
23+
</phpunit>

0 commit comments

Comments
 (0)