Skip to content
This repository was archived by the owner on Jan 4, 2025. It is now read-only.

Commit 9c7ca2e

Browse files
committed
Initial commit
0 parents  commit 9c7ca2e

19 files changed

+1011
-0
lines changed

.ddev/commands/host/change-env

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/bin/bash
2+
3+
# Keys
4+
declare -a values=(
5+
"php8.0-drupal9"
6+
"php8.1-drupal9"
7+
"php8.1-drupal10"
8+
)
9+
10+
# Labels
11+
declare -a labels=(
12+
"PHP 8.0 | Drupal 9"
13+
"PHP 8.1 | Drupal 9"
14+
"PHP 8.1 | Drupal 10"
15+
)
16+
17+
echo "Available configurations"
18+
echo "-----------------------"
19+
20+
# Loop through array with a counter
21+
i=0
22+
23+
for config in "${labels[@]}"; do
24+
echo "[$i] $config"
25+
((i++))
26+
done
27+
28+
echo ""
29+
30+
# Ask user for input
31+
read -p "Select configuration: " num
32+
33+
echo ""
34+
35+
# Check if input is a number
36+
re='^[0-9]+$'
37+
if ! [[ $num =~ $re ]] ; then
38+
echo "error: Not a number" >&2; exit 1
39+
fi
40+
41+
# Check if input is within array bounds
42+
if [ $num -lt 0 ] || [ $num -ge ${#values[@]} ]; then
43+
echo "error: Out of bounds" >&2; exit 1
44+
fi
45+
46+
# Set selected configuration
47+
selectedValue=${values[$num]}
48+
selectedLabel=${labels[$num]}
49+
50+
echo "Selected configuration: $selectedLabel"
51+
52+
confFile=".ddev/config.env.yaml"
53+
54+
# Switch case
55+
case $selectedValue in
56+
"php8.0-drupal9")
57+
printf "php_version: \"8.0\"\nweb_environment:\n - DRUPAL_CORE_CONSTRAINT=^9" > $confFile
58+
;;
59+
"php8.1-drupal9")
60+
if [ -f "$confFile" ]; then
61+
rm $confFile
62+
fi
63+
;;
64+
"php8.1-drupal10")
65+
printf "web_environment:\n - DRUPAL_CORE_CONSTRAINT=^10" > $confFile
66+
;;
67+
*)
68+
echo "error: Unknown configuration" >&2; exit 1
69+
;;
70+
esac
71+
72+
ddev start

.ddev/commands/web/phpcbf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
composer phpcbf -- --report-full --report-summary --report-source --ignore=*/.ddev/*
4+

.ddev/commands/web/phpcs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
composer phpcs -- --report-full --report-summary --report-source --ignore=*/.ddev/*

.ddev/commands/web/phpunit

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
composer unit -- --verbose $@

.ddev/config.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: simple-oauth-auth-code
2+
type: php
3+
docroot: web
4+
php_version: "8.1"
5+
webserver_type: nginx-fpm
6+
router_http_port: "80"
7+
router_https_port: "443"
8+
xdebug_enabled: false
9+
additional_hostnames: []
10+
additional_fqdns: []
11+
database:
12+
type: mariadb
13+
version: "10.4"
14+
nfs_mount_enabled: false
15+
mutagen_enabled: false
16+
use_dns_when_possible: true
17+
composer_version: "2"
18+
web_environment:
19+
- DRUPAL_CORE_CONSTRAINT=^9
20+
- COMPOSER=composer.spoons.json
21+
- WEB_ROOT=web
22+
- NONINTERACTIVE=1
23+
- COMPOSER_NO_INTERACTION=1
24+
- WEB_PORT=9000
25+
- SIMPLETEST_BASE_URL=http://localhost
26+
- SIMPLETEST_DB=sqlite://localhost/sites/default/files/.sqlite
27+
nodejs_version: "16"
28+
hooks:
29+
post-start:
30+
- exec: "rm .composer-plugin.env composer.spoons.json composer.spoons.lock || true"
31+
- exec: "bash <(curl -s https://gitlab.com/drupalspoons/composer-plugin/-/raw/master/bin/setup)"
32+
- exec: "drush status"
33+
post-stop:
34+
- exec-host: "rm -rf web vendor"

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Drupal editor configuration normalization
2+
# @see http://editorconfig.org/
3+
4+
# This is the top-most .editorconfig file; do not search in parent directories.
5+
root = true
6+
7+
# All files.
8+
[*]
9+
end_of_line = LF
10+
indent_style = space
11+
indent_size = 2
12+
charset = utf-8
13+
trim_trailing_whitespace = true
14+
insert_final_newline = true
15+
16+
[composer.{json,lock}]
17+
indent_size = 4

.gitattributes

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Drupal git normalization
2+
# @see https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
# @see https://www.drupal.org/node/1542048
4+
5+
# Normally these settings would be done with macro attributes for improved
6+
# readability and easier maintenance. However macros can only be defined at the
7+
# repository root directory. Drupal avoids making any assumptions about where it
8+
# is installed.
9+
10+
# Define text file attributes.
11+
# - Treat them as text.
12+
# - Ensure no CRLF line-endings, neither on checkout nor on checkin.
13+
# - Detect whitespace errors.
14+
# - Exposed by default in `git diff --color` on the CLI.
15+
# - Validate with `git diff --check`.
16+
# - Deny applying with `git apply --whitespace=error-all`.
17+
# - Fix automatically with `git apply --whitespace=fix`.
18+
19+
*.config text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
20+
*.css text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
21+
*.dist text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
22+
*.engine text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
23+
*.html text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=html
24+
*.inc text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
25+
*.install text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
26+
*.js text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
27+
*.json text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
28+
*.lock text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
29+
*.map text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
30+
*.md text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
31+
*.module text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
32+
*.php text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
33+
*.po text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
34+
*.profile text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
35+
*.script text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
36+
*.sh text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
37+
*.sql text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
38+
*.svg text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
39+
*.theme text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
40+
*.twig text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
41+
*.txt text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
42+
*.xml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
43+
*.yml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
44+
45+
# Define binary file attributes.
46+
# - Do not treat them as text.
47+
# - Include binary diff in patches instead of "binary files differ."
48+
*.eot -text diff
49+
*.exe -text diff
50+
*.gif -text diff
51+
*.gz -text diff
52+
*.ico -text diff
53+
*.jpeg -text diff
54+
*.jpg -text diff
55+
*.otf -text diff
56+
*.phar -text diff
57+
*.png -text diff
58+
*.svgz -text diff
59+
*.ttf -text diff
60+
*.woff -text diff
61+
*.woff2 -text diff

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/composer.spoons.json
2+
/composer.spoons.lock
3+
/vendor/
4+
/web/
5+
/.env
6+
.envrc
7+
.envrc.local
8+
.composer-plugin.env

.gitlab-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include:
2+
- remote: 'https://gitlab.com/drupalspoons/composer-plugin/-/raw/2.10.16/templates/.gitlab-ci.yml'

composer.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "drupal/simple_oauth_auth_code",
3+
"description": "Companion module for simple_oauth. Provides means to generate authorization codes programatically.",
4+
"type": "drupal-module",
5+
"require": {
6+
"drupal/verification": "1.0.x-dev@dev",
7+
"drupal/simple_oauth": "^6",
8+
"php": ">=8.1",
9+
"wunderwerkio/http-api-utils": "^0.1.0",
10+
"wunderwerkio/jsonapi-error": "^0.1.0"
11+
},
12+
"require-dev": {
13+
"phpspec/prophecy-phpunit": "^2"
14+
},
15+
"license": "GPL-2.0-or-later",
16+
"extra": {
17+
"drush": {
18+
"services": {
19+
"drush.services.yml": "^9 || ^10"
20+
}
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)