Signed-off-by: Jean-Yves <7360784+docjyJ@users.noreply.github.com>
This commit is contained in:
Jean-Yves 2024-07-25 18:12:58 +02:00
parent 00c41624ea
commit 31162a29d8
No known key found for this signature in database
GPG key ID: 644C8B9C4CABAEF7
12 changed files with 2071 additions and 121 deletions

View file

@ -28,7 +28,6 @@ jobs:
run: | run: |
set -x set -x
cd php cd php
composer global require wapmorgan/php-deprecation-detector dev-master
composer install composer install
composer run php-deprecation-detector | tee -i ./phpdd.log composer run php-deprecation-detector | tee -i ./phpdd.log
if grep "Total issues:" ./phpdd.log; then if grep "Total issues:" ./phpdd.log; then

View file

@ -23,9 +23,8 @@ jobs:
run: | run: |
set -x set -x
cd php cd php
composer global require vimeo/psalm --prefer-dist --no-progress --dev
composer install composer install
composer run psalm -- --monochrome --no-progress --output-format=text --update-baseline composer run psalm:update-baseline
git clean -f lib/composer git clean -f lib/composer
git checkout composer.json composer.lock lib/composer git checkout composer.json composer.lock lib/composer
continue-on-error: true continue-on-error: true

View file

@ -42,6 +42,5 @@ jobs:
run: | run: |
set -x set -x
cd php cd php
composer global require vimeo/psalm --prefer-dist --no-progress --dev
composer install composer install
composer run psalm composer run psalm

View file

@ -13,7 +13,7 @@ on:
permissions: permissions:
contents: read contents: read
concurrency: concurrency:
group: lint-twig-${{ github.head_ref || github.run_id }} group: lint-twig-${{ github.head_ref || github.run_id }}
cancel-in-progress: true cancel-in-progress: true
@ -36,7 +36,5 @@ jobs:
- name: twig lint - name: twig lint
run: | run: |
cd php cd php
composer require sserbin/twig-linter:@dev --no-progress --dev
composer install composer install
chmod +x ./vendor/bin/twig-linter composer run lint:twig
./vendor/bin/twig-linter lint ./templates

8
php/.idea/.gitignore generated vendored
View file

@ -1,8 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

34
php/.idea/aio.iml generated
View file

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" packagePrefix="AIO\" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-server-middleware" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/psr7" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/log" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/guzzle" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-client" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-message" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/promises" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-factory" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" />
<excludeFolder url="file://$MODULE_DIR$/vendor/http-interop/http-factory-guzzle" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-server-handler" />
<excludeFolder url="file://$MODULE_DIR$/vendor/slim/slim" />
<excludeFolder url="file://$MODULE_DIR$/vendor/ralouphie/getallheaders" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nikic/fast-route" />
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/opis/closure" />
<excludeFolder url="file://$MODULE_DIR$/vendor/php-di/slim-bridge" />
<excludeFolder url="file://$MODULE_DIR$/vendor/php-di/invoker" />
<excludeFolder url="file://$MODULE_DIR$/vendor/php-di/php-di" />
<excludeFolder url="file://$MODULE_DIR$/vendor/php-di/phpdoc-reader" />
<excludeFolder url="file://$MODULE_DIR$/vendor/slim/twig-view" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" />
<excludeFolder url="file://$MODULE_DIR$/vendor/twig/twig" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-ctype" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

8
php/.idea/modules.xml generated
View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/aio.iml" filepath="$PROJECT_DIR$/.idea/aio.iml" />
</modules>
</component>
</project>

34
php/.idea/php.xml generated
View file

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PhpIncludePathManager">
<include_path>
<path value="$PROJECT_DIR$/vendor/psr/http-server-middleware" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/psr7" />
<path value="$PROJECT_DIR$/vendor/psr/log" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/guzzle" />
<path value="$PROJECT_DIR$/vendor/psr/http-client" />
<path value="$PROJECT_DIR$/vendor/psr/http-message" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/promises" />
<path value="$PROJECT_DIR$/vendor/psr/http-factory" />
<path value="$PROJECT_DIR$/vendor/psr/container" />
<path value="$PROJECT_DIR$/vendor/http-interop/http-factory-guzzle" />
<path value="$PROJECT_DIR$/vendor/psr/http-server-handler" />
<path value="$PROJECT_DIR$/vendor/slim/slim" />
<path value="$PROJECT_DIR$/vendor/ralouphie/getallheaders" />
<path value="$PROJECT_DIR$/vendor/nikic/fast-route" />
<path value="$PROJECT_DIR$/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/opis/closure" />
<path value="$PROJECT_DIR$/vendor/php-di/slim-bridge" />
<path value="$PROJECT_DIR$/vendor/php-di/invoker" />
<path value="$PROJECT_DIR$/vendor/php-di/php-di" />
<path value="$PROJECT_DIR$/vendor/php-di/phpdoc-reader" />
<path value="$PROJECT_DIR$/vendor/slim/twig-view" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
<path value="$PROJECT_DIR$/vendor/twig/twig" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="7.4">
<option name="suggestChangeDefaultLanguageLevel" value="false" />
</component>
</project>

6
php/.idea/vcs.xml generated
View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

View file

@ -7,10 +7,34 @@ This is the code for the PHP Docker controller.
Running this locally requires Docker Engine on the same machine. Running this locally requires Docker Engine on the same machine.
If this is the case, just execute the following command: If this is the case, just execute the following command:
``` ```bash
composer install --no-dev composer install
cd public/ sudo SKIP_DOMAIN_VALIDATION=true composer run dev # sudo is required to access docker socket
php -S 0.0.0.0:8080
``` ```
You can then access the web interface at `localhost:8080`. You can then access the web interface at `localhost:8080`.
If you have an error that says `Couldn't connect to server for http://127.0.0.1/v1.41/networks/create` makes sure a `nextcloud-aio-mastercontainer` is running.
You can start it with the following command:
```bash
sudo docker run \
--rm \
--name nextcloud-aio-mastercontainer \
--volume nextcloud_aio_mastercontainer:/mnt/docker-aio-config \
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
nextcloud/all-in-one:latest
```
## Commands
| Command | Description |
|-----------------------------------------|----------------------------------------|
| `composer run dev` | Starts the development server |
| `composer run psalm` | Run Psalm static analysis |
| `composer run psalm:update-baseline` | Run Psalm with `--update-baseline` arg |
| `composer run lint` | Run PHP Syntax check |
| `composer run lint:twig` | Run Twig Syntax check |
| `composer run php-deprecation-detector` | Run PHP Deprecation Detector |

View file

@ -1,6 +1,6 @@
{ {
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"AIO\\": ["src/"] "AIO\\": ["src/"]
} }
}, },
@ -18,10 +18,20 @@
"slim/csrf": "^1.3", "slim/csrf": "^1.3",
"ext-apcu": "*" "ext-apcu": "*"
}, },
"require-dev": {
"sserbin/twig-linter": "@dev",
"vimeo/psalm": "^5.25",
"wapmorgan/php-deprecation-detector": "dev-master"
},
"scripts": { "scripts": {
"dev": [
"Composer\\Config::disableProcessTimeout",
"php -S localhost:8080 -t public"
],
"psalm": "psalm --threads=1", "psalm": "psalm --threads=1",
"psalm:update-baseline": "psalm --threads=1 --update-baseline", "psalm:update-baseline": "psalm --threads=1 --monochrome --no-progress --output-format=text --update-baseline",
"lint": "find . -name \\*.php -not -path './vendor/*' -exec php -l {} \\;", "lint": "php -l src/*.php src/**/*.php public/index.php",
"php-deprecation-detector": "find . -name \\*.php -not -path './vendor/*' -exec phpdd scan {} -n -t 8.3 \\;" "lint:twig": "twig-linter lint ./templates",
"php-deprecation-detector": "phpdd scan -n -t 8.3 src/*.php src/**/*.php public/index.php"
} }
} }

2041
php/composer.lock generated

File diff suppressed because it is too large Load diff