Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Yves <[email protected]>
  • Loading branch information
docjyJ committed Jul 25, 2024
1 parent 00c4162 commit 31162a2
Show file tree
Hide file tree
Showing 12 changed files with 2,071 additions and 121 deletions.
1 change: 0 additions & 1 deletion .github/workflows/php-deprecation-detector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
run: |
set -x
cd php
composer global require wapmorgan/php-deprecation-detector dev-master
composer install
composer run php-deprecation-detector | tee -i ./phpdd.log
if grep "Total issues:" ./phpdd.log; then
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/psalm-update-baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ jobs:
run: |
set -x
cd php
composer global require vimeo/psalm --prefer-dist --no-progress --dev
composer install
composer run psalm -- --monochrome --no-progress --output-format=text --update-baseline
composer run psalm:update-baseline
git clean -f lib/composer
git checkout composer.json composer.lock lib/composer
continue-on-error: true
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,5 @@ jobs:
run: |
set -x
cd php
composer global require vimeo/psalm --prefer-dist --no-progress --dev
composer install
composer run psalm
6 changes: 2 additions & 4 deletions .github/workflows/twig-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
permissions:
contents: read

concurrency:
concurrency:
group: lint-twig-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

Expand All @@ -36,7 +36,5 @@ jobs:
- name: twig lint
run: |
cd php
composer require sserbin/twig-linter:@dev --no-progress --dev
composer install
chmod +x ./vendor/bin/twig-linter
./vendor/bin/twig-linter lint ./templates
composer run lint:twig
8 changes: 0 additions & 8 deletions php/.idea/.gitignore

This file was deleted.

34 changes: 0 additions & 34 deletions php/.idea/aio.iml

This file was deleted.

8 changes: 0 additions & 8 deletions php/.idea/modules.xml

This file was deleted.

34 changes: 0 additions & 34 deletions php/.idea/php.xml

This file was deleted.

6 changes: 0 additions & 6 deletions php/.idea/vcs.xml

This file was deleted.

32 changes: 28 additions & 4 deletions php/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,34 @@ This is the code for the PHP Docker controller.
Running this locally requires Docker Engine on the same machine.
If this is the case, just execute the following command:

```
composer install --no-dev
cd public/
php -S 0.0.0.0:8080
```bash
composer install
sudo SKIP_DOMAIN_VALIDATION=true composer run dev # sudo is required to access docker socket
```

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 |


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

0 comments on commit 31162a2

Please sign in to comment.