You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Florian Eisenmenger a0d33182ef partner fix task fix 2 years ago
.ddev tasks post, patch, delete 2 years ago
.docs contacts 2 years ago
bin initial with ddev 2 years ago
config auto export forms 2 years ago
export partner fix task fix 2 years ago
migrations tasks post, patch, delete 2 years ago
public fixture data done 2 years ago
src partner fix task fix 2 years ago
templates initial with ddev 2 years ago
tests tasks post, patch, delete 2 years ago
translations initial with ddev 2 years ago
.env xdebug 2 years ago
.env.test initial with ddev 2 years ago
.gitignore fixture data done 2 years ago
README.md openapi 2 years ago
composer.json auto export forms 2 years ago
composer.lock some changes 2 years ago
phpunit.xml.dist first setup wip 2 years ago
symfony.lock normalization of media object 2 years ago

README.md

matsen-tool-be

Installation:

gehe ins root Verzeichnis des Projekts und für aus: ddev config

gehe den Installationsprozess durch (3x Enter drücken)

starte danach ddev mit: ddev start

projekt installieren: ddev composer install

Troubleshooting:

Unable to listen on required ports, port 443 is already in use
-> setze andere Ports in .ddev/config.yaml z.B.
router_http_port: 8080
router_https_port: 8443

- https://stackoverflow.com/questions/76507208/symfony-6-3-migration-causes-problems-with-stateless-authenticators-forcing-requ

PHPMyAdmin installieren:

ddev get ddev/ddev-phpmyadmin

ddev restart

Symfony Konsolenbefehle mit Ddev ausführen, z.B.:

ddev exec php bin/console make:migration

Ddev Commands:

ddev describe - zeigt Urls und installierte Komponenten

Xdebug

ddev ssh -> export XDEBUG_CONFIG="idekey=PHPSTORM"
  • Cli Skript xebug läuft nicht korrekt:
    • ddev ssh
    • in Terminal: PHP_IDE_CONFIG="serverName=matsen-tool-be.ddev.site”
    • Servername ist hier konfiguriert:

Symfony:

User with Maker Bundle:

- https://symfonycasts.com/screencast/api-platform/user-entity
ddev composer require maker-bundle --dev
ddev exec bin/console make:user -> erstellt user entity und schreibt in die security.yaml

Entity erzeugen oder erweitern:

ddev exec bin/console make:entity

Foundry fixtures:

ddev exec composer require foundry orm-fixtures --dev
ddev exec bin/console make:factory
ddev exec bin/console doctrine:fixtures:load

Doctrine:

ddev exec bin/console doctrine:database:drop --force
ddev exec bin/console doctrine:database:create

- Testdatenbank anlegen:
    ddev exec bin/console doctrine:database:create --env=test
    ddev exec bin/console doctrine:schema:create --env=test

- Migrations:
ddev exec bin/console make:migration
ddev exec bin/console doctrine:migration:migrate

Profiler

ddev composer require debug

Php Unit

- https://symfony.com/doc/current/testing.html#configuring-a-database-for-tests
Setup:
    # .env.test.local -> "mysql://root:root@db:3306/db?serverVersion=10.4.30-MariaDB-1:10.4.30+maria~ubu2004-log - mariadb.org binary distribution"
        -> this creates a db named db_test (it takes the name of the main database "db" and adds "_test" to its name)
    # Create db and create schema
        php bin/console --env=test doctrine:database:create
        php bin/console --env=test doctrine:schema:create

- https://symfonycasts.com/screencast/api-platform-security/test-setup
ddev composer require test -> testpack incl. phpunit
ddev composer require zenstruck/browser --dev -> browser test package to imporve testing
    -> add extension to phpunit.xml.dist
            <extensions>
                <extension class="Zenstruck\Browser\Test\BrowserExtension" />
            </extensions>

ddev exec php bin/phpunit --filter=testPostToCreateNewUserPost

ddev composer require --dev mtdowling/jmespath.php

Api Platform

- https://api-platform.com/docs/core/dto/
- https://api-platform.com/docs/distribution/
- https://api-platform.com/docs/core/extending/

Ausführen, um openApi.yaml und openApi.json zu generieren:
- cd export
- php exportApi.php
openApi.yaml und openApi.json in Frontend-Projekt (root) kopieren

Lexik JWT

- https://symfony.com/bundles/LexikJWTAuthenticationBundle/current/index.html
- Nur bei NEU Installation:
    - php bin/console lexik:jwt:generate-keypair

- Open Api export:
    ddev exec bin/console api:openapi:export --yaml >> openapi.yaml
- File Uploading:
    https://api-platform.com/docs/core/file-upload/
    https://github.com/dustin10/VichUploaderBundle/blob/master/docs/index.md

List Routes and Service Tags

- ddev exec bin/console debug:router
- ddev exec bin/console debug:container

Constraints

- https://symfony.com/doc/current/validation.html