added db to symfony
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
var/cache/*
|
||||||
|
var/log/*
|
||||||
|
vendor/
|
||||||
|
Dockerfile
|
||||||
|
compose.yaml
|
||||||
|
README.md
|
||||||
@@ -25,3 +25,13 @@ APP_SHARE_DIR=var/share
|
|||||||
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
|
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
|
||||||
DEFAULT_URI=http://localhost
|
DEFAULT_URI=http://localhost
|
||||||
###< symfony/routing ###
|
###< symfony/routing ###
|
||||||
|
|
||||||
|
###> doctrine/doctrine-bundle ###
|
||||||
|
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
|
||||||
|
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
|
||||||
|
#
|
||||||
|
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data_%kernel.environment%.db"
|
||||||
|
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4"
|
||||||
|
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
|
||||||
|
DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&charset=utf8"
|
||||||
|
###< doctrine/doctrine-bundle ###
|
||||||
|
|||||||
+39
@@ -0,0 +1,39 @@
|
|||||||
|
FROM dunglas/frankenphp:1-php8.4-bookworm
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Install extensions Symfony commonly needs now,
|
||||||
|
# plus MariaDB support for the next phase.
|
||||||
|
RUN install-php-extensions \
|
||||||
|
intl \
|
||||||
|
opcache \
|
||||||
|
pdo_mysql \
|
||||||
|
zip
|
||||||
|
|
||||||
|
# Copy Composer from its official image.
|
||||||
|
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||||
|
|
||||||
|
# Copy dependency definitions first.
|
||||||
|
# This allows Docker to cache composer install between builds.
|
||||||
|
COPY composer.json composer.lock symfony.lock ./
|
||||||
|
|
||||||
|
ENV APP_ENV=prod
|
||||||
|
ENV APP_DEBUG=0
|
||||||
|
ENV SERVER_NAME=:8080
|
||||||
|
|
||||||
|
RUN composer install \
|
||||||
|
--no-dev \
|
||||||
|
--prefer-dist \
|
||||||
|
--no-interaction \
|
||||||
|
--no-progress \
|
||||||
|
--no-scripts
|
||||||
|
|
||||||
|
# Copy the rest of the Symfony project.
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Run Symfony/Flex scripts now that the complete project exists.
|
||||||
|
RUN composer run-script post-install-cmd \
|
||||||
|
&& mkdir -p var/cache var/log \
|
||||||
|
&& chown -R www-data:www-data var
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
services:
|
||||||
|
###> doctrine/doctrine-bundle ###
|
||||||
|
database:
|
||||||
|
ports:
|
||||||
|
- "5432"
|
||||||
|
###< doctrine/doctrine-bundle ###
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
services:
|
||||||
|
###> doctrine/doctrine-bundle ###
|
||||||
|
database:
|
||||||
|
image: postgres:${POSTGRES_VERSION:-16}-alpine
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: ${POSTGRES_DB:-app}
|
||||||
|
# You should definitely change the password in production
|
||||||
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}
|
||||||
|
POSTGRES_USER: ${POSTGRES_USER:-app}
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "pg_isready", "-d", "${POSTGRES_DB:-app}", "-U", "${POSTGRES_USER:-app}"]
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
start_period: 60s
|
||||||
|
volumes:
|
||||||
|
- database_data:/var/lib/postgresql/data:rw
|
||||||
|
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
|
||||||
|
# - ./docker/db/data:/var/lib/postgresql/data:rw
|
||||||
|
###< doctrine/doctrine-bundle ###
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
###> doctrine/doctrine-bundle ###
|
||||||
|
database_data:
|
||||||
|
###< doctrine/doctrine-bundle ###
|
||||||
+10
-2
@@ -7,15 +7,18 @@
|
|||||||
"php": ">=8.4",
|
"php": ">=8.4",
|
||||||
"ext-ctype": "*",
|
"ext-ctype": "*",
|
||||||
"ext-iconv": "*",
|
"ext-iconv": "*",
|
||||||
|
"doctrine/doctrine-bundle": "^3.3",
|
||||||
|
"doctrine/doctrine-migrations-bundle": "^4.0",
|
||||||
|
"doctrine/orm": "^3.6",
|
||||||
"symfony/console": "8.1.*",
|
"symfony/console": "8.1.*",
|
||||||
"symfony/dotenv": "8.1.*",
|
"symfony/dotenv": "8.1.*",
|
||||||
"symfony/flex": "^2",
|
"symfony/flex": "^2",
|
||||||
"symfony/framework-bundle": "8.1.*",
|
"symfony/framework-bundle": "8.1.*",
|
||||||
"symfony/runtime": "8.1.*",
|
"symfony/runtime": "8.1.*",
|
||||||
|
"symfony/security-bundle": "8.1.*",
|
||||||
|
"symfony/twig-bundle": "8.1.*",
|
||||||
"symfony/yaml": "8.1.*"
|
"symfony/yaml": "8.1.*"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
|
||||||
},
|
|
||||||
"config": {
|
"config": {
|
||||||
"allow-plugins": {
|
"allow-plugins": {
|
||||||
"php-http/discovery": true,
|
"php-http/discovery": true,
|
||||||
@@ -67,5 +70,10 @@
|
|||||||
"allow-contrib": false,
|
"allow-contrib": false,
|
||||||
"require": "8.1.*"
|
"require": "8.1.*"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"symfony/maker-bundle": "^1.67",
|
||||||
|
"symfony/stopwatch": "8.1.*",
|
||||||
|
"symfony/web-profiler-bundle": "8.1.*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+2743
-4
File diff suppressed because it is too large
Load Diff
@@ -2,4 +2,10 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
|
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
|
||||||
|
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
|
||||||
|
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
|
||||||
|
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
|
||||||
|
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
|
||||||
|
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
|
||||||
|
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
doctrine:
|
||||||
|
dbal:
|
||||||
|
url: '%env(resolve:DATABASE_URL)%'
|
||||||
|
|
||||||
|
# IMPORTANT: You MUST configure your server version,
|
||||||
|
# either here or in the DATABASE_URL env var (see .env file)
|
||||||
|
#server_version: '16'
|
||||||
|
|
||||||
|
profiling_collect_backtrace: '%kernel.debug%'
|
||||||
|
orm:
|
||||||
|
validate_xml_mapping: true
|
||||||
|
naming_strategy: doctrine.orm.naming_strategy.underscore
|
||||||
|
identity_generation_preferences:
|
||||||
|
Doctrine\DBAL\Platforms\PostgreSQLPlatform: identity
|
||||||
|
auto_mapping: true
|
||||||
|
mappings:
|
||||||
|
App:
|
||||||
|
type: attribute
|
||||||
|
is_bundle: false
|
||||||
|
dir: '%kernel.project_dir%/src/Entity'
|
||||||
|
prefix: 'App\Entity'
|
||||||
|
alias: App
|
||||||
|
|
||||||
|
when@test:
|
||||||
|
doctrine:
|
||||||
|
dbal:
|
||||||
|
# "TEST_TOKEN" is typically set by ParaTest
|
||||||
|
dbname_suffix: '_test%env(default::TEST_TOKEN)%'
|
||||||
|
|
||||||
|
when@prod:
|
||||||
|
doctrine:
|
||||||
|
orm:
|
||||||
|
query_cache_driver:
|
||||||
|
type: pool
|
||||||
|
pool: doctrine.system_cache_pool
|
||||||
|
result_cache_driver:
|
||||||
|
type: pool
|
||||||
|
pool: doctrine.result_cache_pool
|
||||||
|
|
||||||
|
framework:
|
||||||
|
cache:
|
||||||
|
pools:
|
||||||
|
doctrine.result_cache_pool:
|
||||||
|
adapter: cache.app
|
||||||
|
doctrine.system_cache_pool:
|
||||||
|
adapter: cache.system
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
doctrine_migrations:
|
||||||
|
migrations_paths:
|
||||||
|
# namespace is arbitrary but should be different from App\Migrations
|
||||||
|
# as migrations classes should NOT be autoloaded
|
||||||
|
'DoctrineMigrations': '%kernel.project_dir%/migrations'
|
||||||
|
enable_profiler: false
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
framework:
|
||||||
|
property_info:
|
||||||
|
with_constructor_extractor: true
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
security:
|
||||||
|
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
|
||||||
|
password_hashers:
|
||||||
|
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
|
||||||
|
|
||||||
|
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
|
||||||
|
providers:
|
||||||
|
# used to reload user from session & other features (e.g. switch_user)
|
||||||
|
app_user_provider:
|
||||||
|
entity:
|
||||||
|
class: App\Entity\User
|
||||||
|
property: email
|
||||||
|
|
||||||
|
firewalls:
|
||||||
|
dev:
|
||||||
|
# Ensure dev tools and static assets are always allowed
|
||||||
|
pattern: ^/(_profiler|_wdt|assets|build)/
|
||||||
|
security: false
|
||||||
|
main:
|
||||||
|
lazy: true
|
||||||
|
provider: app_user_provider
|
||||||
|
form_login:
|
||||||
|
login_path: app_login
|
||||||
|
check_path: app_login
|
||||||
|
enable_csrf: true
|
||||||
|
logout:
|
||||||
|
path: app_logout
|
||||||
|
# where to redirect after logout
|
||||||
|
# target: app_any_route
|
||||||
|
|
||||||
|
# Activate different ways to authenticate:
|
||||||
|
# https://symfony.com/doc/current/security.html#the-firewall
|
||||||
|
|
||||||
|
# https://symfony.com/doc/current/security/impersonating_user.html
|
||||||
|
# switch_user: true
|
||||||
|
|
||||||
|
# Note: Only the *first* matching rule is applied
|
||||||
|
access_control:
|
||||||
|
# - { path: ^/admin, roles: ROLE_ADMIN }
|
||||||
|
# - { path: ^/profile, roles: ROLE_USER }
|
||||||
|
- { path: ^/login$, roles: PUBLIC_ACCESS }
|
||||||
|
- { path: ^/_profiler, roles: PUBLIC_ACCESS }
|
||||||
|
- { path: ^/_wdt, roles: PUBLIC_ACCESS }
|
||||||
|
- { path: ^/, roles: ROLE_USER }
|
||||||
|
when@test:
|
||||||
|
security:
|
||||||
|
password_hashers:
|
||||||
|
# Password hashers are resource-intensive by design to ensure security.
|
||||||
|
# In tests, it's safe to reduce their cost to improve performance.
|
||||||
|
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
|
||||||
|
algorithm: auto
|
||||||
|
cost: 4 # Lowest possible value for bcrypt
|
||||||
|
time_cost: 3 # Lowest possible value for argon
|
||||||
|
memory_cost: 10 # Lowest possible value for argon
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
twig:
|
||||||
|
file_name_pattern: '*.twig'
|
||||||
|
|
||||||
|
when@test:
|
||||||
|
twig:
|
||||||
|
strict_variables: true
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
when@dev:
|
||||||
|
web_profiler:
|
||||||
|
toolbar: true
|
||||||
|
|
||||||
|
framework:
|
||||||
|
profiler: true
|
||||||
|
|
||||||
|
when@test:
|
||||||
|
framework:
|
||||||
|
profiler:
|
||||||
|
collect: false
|
||||||
+584
-3
@@ -369,7 +369,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
|||||||
* }>,
|
* }>,
|
||||||
* },
|
* },
|
||||||
* property_access?: bool|array{ // Property access configuration
|
* property_access?: bool|array{ // Property access configuration
|
||||||
* enabled?: bool|Param, // Default: false
|
* enabled?: bool|Param, // Default: true
|
||||||
* magic_call?: bool|Param, // Default: false
|
* magic_call?: bool|Param, // Default: false
|
||||||
* magic_get?: bool|Param, // Default: true
|
* magic_get?: bool|Param, // Default: true
|
||||||
* magic_set?: bool|Param, // Default: true
|
* magic_set?: bool|Param, // Default: true
|
||||||
@@ -377,11 +377,11 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
|||||||
* throw_exception_on_invalid_property_path?: bool|Param, // Default: true
|
* throw_exception_on_invalid_property_path?: bool|Param, // Default: true
|
||||||
* },
|
* },
|
||||||
* type_info?: bool|array{ // Type info configuration
|
* type_info?: bool|array{ // Type info configuration
|
||||||
* enabled?: bool|Param, // Default: false
|
* enabled?: bool|Param, // Default: true
|
||||||
* aliases?: array<string, scalar|Param|null>,
|
* aliases?: array<string, scalar|Param|null>,
|
||||||
* },
|
* },
|
||||||
* property_info?: bool|array{ // Property info configuration
|
* property_info?: bool|array{ // Property info configuration
|
||||||
* enabled?: bool|Param, // Default: false
|
* enabled?: bool|Param, // Default: true
|
||||||
* with_constructor_extractor?: bool|Param, // Registers the constructor extractor. // Default: true
|
* with_constructor_extractor?: bool|Param, // Registers the constructor extractor. // Default: true
|
||||||
* },
|
* },
|
||||||
* cache?: array{ // Cache configuration
|
* cache?: array{ // Cache configuration
|
||||||
@@ -701,28 +701,609 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
|||||||
* },
|
* },
|
||||||
* },
|
* },
|
||||||
* }
|
* }
|
||||||
|
* @psalm-type DoctrineConfig = array{
|
||||||
|
* dbal?: array{
|
||||||
|
* default_connection?: scalar|Param|null,
|
||||||
|
* types?: array<string, string|array{ // Default: []
|
||||||
|
* class?: scalar|Param|null,
|
||||||
|
* }>,
|
||||||
|
* driver_schemes?: array<string, scalar|Param|null>,
|
||||||
|
* connections?: array<string, array{ // Default: []
|
||||||
|
* url?: scalar|Param|null, // A URL with connection information; any parameter value parsed from this string will override explicitly set parameters
|
||||||
|
* dbname?: scalar|Param|null,
|
||||||
|
* host?: scalar|Param|null, // Defaults to "localhost" at runtime.
|
||||||
|
* port?: scalar|Param|null, // Defaults to null at runtime.
|
||||||
|
* user?: scalar|Param|null, // Defaults to "root" at runtime.
|
||||||
|
* password?: scalar|Param|null, // Defaults to null at runtime.
|
||||||
|
* dbname_suffix?: scalar|Param|null, // Adds the given suffix to the configured database name, this option has no effects for the SQLite platform
|
||||||
|
* application_name?: scalar|Param|null,
|
||||||
|
* charset?: scalar|Param|null,
|
||||||
|
* path?: scalar|Param|null,
|
||||||
|
* memory?: bool|Param,
|
||||||
|
* unix_socket?: scalar|Param|null, // The unix socket to use for MySQL
|
||||||
|
* persistent?: bool|Param, // True to use as persistent connection for the ibm_db2 driver
|
||||||
|
* protocol?: scalar|Param|null, // The protocol to use for the ibm_db2 driver (default to TCPIP if omitted)
|
||||||
|
* service?: bool|Param, // True to use SERVICE_NAME as connection parameter instead of SID for Oracle
|
||||||
|
* servicename?: scalar|Param|null, // Overrules dbname parameter if given and used as SERVICE_NAME or SID connection parameter for Oracle depending on the service parameter.
|
||||||
|
* sessionMode?: scalar|Param|null, // The session mode to use for the oci8 driver
|
||||||
|
* server?: scalar|Param|null, // The name of a running database server to connect to for SQL Anywhere.
|
||||||
|
* default_dbname?: scalar|Param|null, // Override the default database (postgres) to connect to for PostgreSQL connection.
|
||||||
|
* sslmode?: scalar|Param|null, // Determines whether or with what priority a SSL TCP/IP connection will be negotiated with the server for PostgreSQL.
|
||||||
|
* sslrootcert?: scalar|Param|null, // The name of a file containing SSL certificate authority (CA) certificate(s). If the file exists, the server's certificate will be verified to be signed by one of these authorities.
|
||||||
|
* sslcert?: scalar|Param|null, // The path to the SSL client certificate file for PostgreSQL.
|
||||||
|
* sslkey?: scalar|Param|null, // The path to the SSL client key file for PostgreSQL.
|
||||||
|
* sslcrl?: scalar|Param|null, // The file name of the SSL certificate revocation list for PostgreSQL.
|
||||||
|
* pooled?: bool|Param, // True to use a pooled server with the oci8/pdo_oracle driver
|
||||||
|
* MultipleActiveResultSets?: bool|Param, // Configuring MultipleActiveResultSets for the pdo_sqlsrv driver
|
||||||
|
* instancename?: scalar|Param|null, // Optional parameter, complete whether to add the INSTANCE_NAME parameter in the connection. It is generally used to connect to an Oracle RAC server to select the name of a particular instance.
|
||||||
|
* connectstring?: scalar|Param|null, // Complete Easy Connect connection descriptor, see https://docs.oracle.com/database/121/NETAG/naming.htm.When using this option, you will still need to provide the user and password parameters, but the other parameters will no longer be used. Note that when using this parameter, the getHost and getPort methods from Doctrine\DBAL\Connection will no longer function as expected.
|
||||||
|
* driver?: scalar|Param|null, // Default: "pdo_mysql"
|
||||||
|
* auto_commit?: bool|Param,
|
||||||
|
* schema_filter?: scalar|Param|null,
|
||||||
|
* logging?: bool|Param, // Default: true
|
||||||
|
* profiling?: bool|Param, // Default: true
|
||||||
|
* profiling_collect_backtrace?: bool|Param, // Enables collecting backtraces when profiling is enabled // Default: false
|
||||||
|
* profiling_collect_schema_errors?: bool|Param, // Enables collecting schema errors when profiling is enabled // Default: true
|
||||||
|
* server_version?: scalar|Param|null,
|
||||||
|
* idle_connection_ttl?: int|Param, // Default: 600
|
||||||
|
* driver_class?: scalar|Param|null,
|
||||||
|
* wrapper_class?: scalar|Param|null,
|
||||||
|
* keep_replica?: bool|Param,
|
||||||
|
* options?: array<string, mixed>,
|
||||||
|
* mapping_types?: array<string, scalar|Param|null>,
|
||||||
|
* default_table_options?: array<string, scalar|Param|null>,
|
||||||
|
* schema_manager_factory?: scalar|Param|null, // Default: "doctrine.dbal.default_schema_manager_factory"
|
||||||
|
* result_cache?: scalar|Param|null,
|
||||||
|
* replicas?: array<string, array{ // Default: []
|
||||||
|
* url?: scalar|Param|null, // A URL with connection information; any parameter value parsed from this string will override explicitly set parameters
|
||||||
|
* dbname?: scalar|Param|null,
|
||||||
|
* host?: scalar|Param|null, // Defaults to "localhost" at runtime.
|
||||||
|
* port?: scalar|Param|null, // Defaults to null at runtime.
|
||||||
|
* user?: scalar|Param|null, // Defaults to "root" at runtime.
|
||||||
|
* password?: scalar|Param|null, // Defaults to null at runtime.
|
||||||
|
* dbname_suffix?: scalar|Param|null, // Adds the given suffix to the configured database name, this option has no effects for the SQLite platform
|
||||||
|
* application_name?: scalar|Param|null,
|
||||||
|
* charset?: scalar|Param|null,
|
||||||
|
* path?: scalar|Param|null,
|
||||||
|
* memory?: bool|Param,
|
||||||
|
* unix_socket?: scalar|Param|null, // The unix socket to use for MySQL
|
||||||
|
* persistent?: bool|Param, // True to use as persistent connection for the ibm_db2 driver
|
||||||
|
* protocol?: scalar|Param|null, // The protocol to use for the ibm_db2 driver (default to TCPIP if omitted)
|
||||||
|
* service?: bool|Param, // True to use SERVICE_NAME as connection parameter instead of SID for Oracle
|
||||||
|
* servicename?: scalar|Param|null, // Overrules dbname parameter if given and used as SERVICE_NAME or SID connection parameter for Oracle depending on the service parameter.
|
||||||
|
* sessionMode?: scalar|Param|null, // The session mode to use for the oci8 driver
|
||||||
|
* server?: scalar|Param|null, // The name of a running database server to connect to for SQL Anywhere.
|
||||||
|
* default_dbname?: scalar|Param|null, // Override the default database (postgres) to connect to for PostgreSQL connection.
|
||||||
|
* sslmode?: scalar|Param|null, // Determines whether or with what priority a SSL TCP/IP connection will be negotiated with the server for PostgreSQL.
|
||||||
|
* sslrootcert?: scalar|Param|null, // The name of a file containing SSL certificate authority (CA) certificate(s). If the file exists, the server's certificate will be verified to be signed by one of these authorities.
|
||||||
|
* sslcert?: scalar|Param|null, // The path to the SSL client certificate file for PostgreSQL.
|
||||||
|
* sslkey?: scalar|Param|null, // The path to the SSL client key file for PostgreSQL.
|
||||||
|
* sslcrl?: scalar|Param|null, // The file name of the SSL certificate revocation list for PostgreSQL.
|
||||||
|
* pooled?: bool|Param, // True to use a pooled server with the oci8/pdo_oracle driver
|
||||||
|
* MultipleActiveResultSets?: bool|Param, // Configuring MultipleActiveResultSets for the pdo_sqlsrv driver
|
||||||
|
* instancename?: scalar|Param|null, // Optional parameter, complete whether to add the INSTANCE_NAME parameter in the connection. It is generally used to connect to an Oracle RAC server to select the name of a particular instance.
|
||||||
|
* connectstring?: scalar|Param|null, // Complete Easy Connect connection descriptor, see https://docs.oracle.com/database/121/NETAG/naming.htm.When using this option, you will still need to provide the user and password parameters, but the other parameters will no longer be used. Note that when using this parameter, the getHost and getPort methods from Doctrine\DBAL\Connection will no longer function as expected.
|
||||||
|
* }>,
|
||||||
|
* }>,
|
||||||
|
* },
|
||||||
|
* orm?: array{
|
||||||
|
* default_entity_manager?: scalar|Param|null,
|
||||||
|
* enable_native_lazy_objects?: bool|Param, // Deprecated: The "enable_native_lazy_objects" option is deprecated and will be removed in DoctrineBundle 4.0, as native lazy objects are now always enabled. // Default: true
|
||||||
|
* controller_resolver?: bool|array{
|
||||||
|
* enabled?: bool|Param, // Default: true
|
||||||
|
* auto_mapping?: bool|Param, // Deprecated: The "doctrine.orm.controller_resolver.auto_mapping.auto_mapping" option is deprecated and will be removed in DoctrineBundle 4.0, as it only accepts `false` since 3.0. // Set to true to enable using route placeholders as lookup criteria when the primary key doesn't match the argument name // Default: false
|
||||||
|
* evict_cache?: bool|Param, // Set to true to fetch the entity from the database instead of using the cache, if any // Default: false
|
||||||
|
* },
|
||||||
|
* entity_managers?: array<string, array{ // Default: []
|
||||||
|
* query_cache_driver?: string|array{
|
||||||
|
* type?: scalar|Param|null, // Default: null
|
||||||
|
* id?: scalar|Param|null,
|
||||||
|
* pool?: scalar|Param|null,
|
||||||
|
* },
|
||||||
|
* metadata_cache_driver?: string|array{
|
||||||
|
* type?: scalar|Param|null, // Default: null
|
||||||
|
* id?: scalar|Param|null,
|
||||||
|
* pool?: scalar|Param|null,
|
||||||
|
* },
|
||||||
|
* result_cache_driver?: string|array{
|
||||||
|
* type?: scalar|Param|null, // Default: null
|
||||||
|
* id?: scalar|Param|null,
|
||||||
|
* pool?: scalar|Param|null,
|
||||||
|
* },
|
||||||
|
* entity_listeners?: array{
|
||||||
|
* entities?: array<string, array{ // Default: []
|
||||||
|
* listeners?: array<string, array{ // Default: []
|
||||||
|
* events?: list<array{ // Default: []
|
||||||
|
* type?: scalar|Param|null,
|
||||||
|
* method?: scalar|Param|null, // Default: null
|
||||||
|
* }>,
|
||||||
|
* }>,
|
||||||
|
* }>,
|
||||||
|
* },
|
||||||
|
* connection?: scalar|Param|null,
|
||||||
|
* class_metadata_factory_name?: scalar|Param|null, // Default: "Doctrine\\ORM\\Mapping\\ClassMetadataFactory"
|
||||||
|
* default_repository_class?: scalar|Param|null, // Default: "Doctrine\\ORM\\EntityRepository"
|
||||||
|
* auto_mapping?: scalar|Param|null, // Default: false
|
||||||
|
* naming_strategy?: scalar|Param|null, // Default: "doctrine.orm.naming_strategy.default"
|
||||||
|
* quote_strategy?: scalar|Param|null, // Default: "doctrine.orm.quote_strategy.default"
|
||||||
|
* typed_field_mapper?: scalar|Param|null, // Default: "doctrine.orm.typed_field_mapper.default"
|
||||||
|
* entity_listener_resolver?: scalar|Param|null, // Default: null
|
||||||
|
* fetch_mode_subselect_batch_size?: scalar|Param|null,
|
||||||
|
* repository_factory?: scalar|Param|null, // Default: "doctrine.orm.container_repository_factory"
|
||||||
|
* schema_ignore_classes?: list<scalar|Param|null>,
|
||||||
|
* validate_xml_mapping?: bool|Param, // Set to "true" to opt-in to the new mapping driver mode that was added in Doctrine ORM 2.14 and will be mandatory in ORM 3.0. See https://github.com/doctrine/orm/pull/6728. // Default: false
|
||||||
|
* second_level_cache?: array{
|
||||||
|
* region_cache_driver?: string|array{
|
||||||
|
* type?: scalar|Param|null, // Default: null
|
||||||
|
* id?: scalar|Param|null,
|
||||||
|
* pool?: scalar|Param|null,
|
||||||
|
* },
|
||||||
|
* region_lock_lifetime?: scalar|Param|null, // Default: 60
|
||||||
|
* log_enabled?: bool|Param, // Default: true
|
||||||
|
* region_lifetime?: scalar|Param|null, // Default: 3600
|
||||||
|
* enabled?: bool|Param, // Default: true
|
||||||
|
* factory?: scalar|Param|null,
|
||||||
|
* regions?: array<string, array{ // Default: []
|
||||||
|
* cache_driver?: string|array{
|
||||||
|
* type?: scalar|Param|null, // Default: null
|
||||||
|
* id?: scalar|Param|null,
|
||||||
|
* pool?: scalar|Param|null,
|
||||||
|
* },
|
||||||
|
* lock_path?: scalar|Param|null, // Default: "%kernel.cache_dir%/doctrine/orm/slc/filelock"
|
||||||
|
* lock_lifetime?: scalar|Param|null, // Default: 60
|
||||||
|
* type?: scalar|Param|null, // Default: "default"
|
||||||
|
* lifetime?: scalar|Param|null, // Default: null
|
||||||
|
* service?: scalar|Param|null,
|
||||||
|
* name?: scalar|Param|null,
|
||||||
|
* }>,
|
||||||
|
* loggers?: array<string, array{ // Default: []
|
||||||
|
* name?: scalar|Param|null,
|
||||||
|
* service?: scalar|Param|null,
|
||||||
|
* }>,
|
||||||
|
* },
|
||||||
|
* hydrators?: array<string, scalar|Param|null>,
|
||||||
|
* mappings?: array<string, bool|string|array{ // Default: []
|
||||||
|
* mapping?: scalar|Param|null, // Default: true
|
||||||
|
* type?: scalar|Param|null,
|
||||||
|
* dir?: scalar|Param|null,
|
||||||
|
* alias?: scalar|Param|null,
|
||||||
|
* prefix?: scalar|Param|null,
|
||||||
|
* is_bundle?: bool|Param,
|
||||||
|
* }>,
|
||||||
|
* dql?: array{
|
||||||
|
* string_functions?: array<string, scalar|Param|null>,
|
||||||
|
* numeric_functions?: array<string, scalar|Param|null>,
|
||||||
|
* datetime_functions?: array<string, scalar|Param|null>,
|
||||||
|
* },
|
||||||
|
* filters?: array<string, string|array{ // Default: []
|
||||||
|
* class?: scalar|Param|null,
|
||||||
|
* enabled?: bool|Param, // Default: false
|
||||||
|
* parameters?: array<string, mixed>,
|
||||||
|
* }>,
|
||||||
|
* identity_generation_preferences?: array<string, scalar|Param|null>,
|
||||||
|
* }>,
|
||||||
|
* resolve_target_entities?: array<string, scalar|Param|null>,
|
||||||
|
* },
|
||||||
|
* }
|
||||||
|
* @psalm-type DoctrineMigrationsConfig = array{
|
||||||
|
* enable_service_migrations?: bool|Param, // Whether to enable fetching migrations from the service container. // Default: false
|
||||||
|
* migrations_paths?: array<string, scalar|Param|null>,
|
||||||
|
* services?: array<string, scalar|Param|null>,
|
||||||
|
* factories?: array<string, scalar|Param|null>,
|
||||||
|
* storage?: array{ // Storage to use for migration status metadata.
|
||||||
|
* table_storage?: array{ // The default metadata storage, implemented as a table in the database.
|
||||||
|
* table_name?: scalar|Param|null, // Default: null
|
||||||
|
* version_column_name?: scalar|Param|null, // Default: null
|
||||||
|
* version_column_length?: scalar|Param|null, // Default: null
|
||||||
|
* executed_at_column_name?: scalar|Param|null, // Default: null
|
||||||
|
* execution_time_column_name?: scalar|Param|null, // Default: null
|
||||||
|
* },
|
||||||
|
* },
|
||||||
|
* migrations?: list<scalar|Param|null>,
|
||||||
|
* connection?: scalar|Param|null, // Connection name to use for the migrations database. // Default: null
|
||||||
|
* em?: scalar|Param|null, // Entity manager name to use for the migrations database (available when doctrine/orm is installed). // Default: null
|
||||||
|
* all_or_nothing?: scalar|Param|null, // Run all migrations in a transaction. // Default: false
|
||||||
|
* check_database_platform?: scalar|Param|null, // Adds an extra check in the generated migrations to allow execution only on the same platform as they were initially generated on. // Default: true
|
||||||
|
* custom_template?: scalar|Param|null, // Custom template path for generated migration classes. // Default: null
|
||||||
|
* organize_migrations?: scalar|Param|null, // Organize migrations mode. Possible values are: "BY_YEAR", "BY_YEAR_AND_MONTH", false // Default: false
|
||||||
|
* enable_profiler?: bool|Param, // Whether or not to enable the profiler collector to calculate and visualize migration status. This adds some queries overhead. // Default: false
|
||||||
|
* transactional?: bool|Param, // Whether or not to wrap migrations in a single transaction. // Default: true
|
||||||
|
* }
|
||||||
|
* @psalm-type MakerConfig = array{
|
||||||
|
* root_namespace?: scalar|Param|null, // Default: "App"
|
||||||
|
* generate_final_classes?: bool|Param, // Default: true
|
||||||
|
* generate_final_entities?: bool|Param, // Default: false
|
||||||
|
* }
|
||||||
|
* @psalm-type SecurityConfig = array{
|
||||||
|
* access_denied_url?: scalar|Param|null, // Default: null
|
||||||
|
* session_fixation_strategy?: "none"|"migrate"|"invalidate"|Param, // Default: "migrate"
|
||||||
|
* expose_security_errors?: \Symfony\Component\Security\Http\Authentication\ExposeSecurityLevel::None|\Symfony\Component\Security\Http\Authentication\ExposeSecurityLevel::AccountStatus|\Symfony\Component\Security\Http\Authentication\ExposeSecurityLevel::All|Param, // Default: "none"
|
||||||
|
* erase_credentials?: bool|Param, // Deprecated: Setting the "security.erase_credentials.erase_credentials" configuration option is deprecated. It will be removed in Symfony 9.0, as the "eraseCredentials()" method was removed in Symfony 8.0. // Default: true
|
||||||
|
* access_decision_manager?: array{
|
||||||
|
* strategy?: "affirmative"|"consensus"|"unanimous"|"priority"|Param,
|
||||||
|
* service?: scalar|Param|null,
|
||||||
|
* strategy_service?: scalar|Param|null,
|
||||||
|
* allow_if_all_abstain?: bool|Param, // Default: false
|
||||||
|
* allow_if_equal_granted_denied?: bool|Param, // Default: true
|
||||||
|
* },
|
||||||
|
* password_hashers?: array<string, string|array{ // Default: []
|
||||||
|
* algorithm?: scalar|Param|null,
|
||||||
|
* migrate_from?: string|list<scalar|Param|null>,
|
||||||
|
* hash_algorithm?: scalar|Param|null, // Name of hashing algorithm for PBKDF2 (i.e. sha256, sha512, etc..) See hash_algos() for a list of supported algorithms. // Default: "sha512"
|
||||||
|
* key_length?: scalar|Param|null, // Default: 40
|
||||||
|
* ignore_case?: bool|Param, // Default: false
|
||||||
|
* encode_as_base64?: bool|Param, // Default: true
|
||||||
|
* iterations?: scalar|Param|null, // Default: 5000
|
||||||
|
* cost?: int|Param, // Default: null
|
||||||
|
* memory_cost?: scalar|Param|null, // Default: null
|
||||||
|
* time_cost?: scalar|Param|null, // Default: null
|
||||||
|
* id?: scalar|Param|null,
|
||||||
|
* }>,
|
||||||
|
* providers?: array<string, array{ // Default: []
|
||||||
|
* id?: scalar|Param|null,
|
||||||
|
* chain?: array{
|
||||||
|
* providers?: string|list<scalar|Param|null>,
|
||||||
|
* },
|
||||||
|
* entity?: array{
|
||||||
|
* class?: scalar|Param|null, // The full entity class name of your user class.
|
||||||
|
* property?: scalar|Param|null, // Default: null
|
||||||
|
* manager_name?: scalar|Param|null, // Default: null
|
||||||
|
* },
|
||||||
|
* memory?: array{
|
||||||
|
* users?: array<string, array{ // Default: []
|
||||||
|
* password?: scalar|Param|null, // Default: null
|
||||||
|
* roles?: string|list<scalar|Param|null>,
|
||||||
|
* }>,
|
||||||
|
* },
|
||||||
|
* ldap?: array{
|
||||||
|
* service?: scalar|Param|null,
|
||||||
|
* base_dn?: scalar|Param|null,
|
||||||
|
* search_dn?: scalar|Param|null, // Default: null
|
||||||
|
* search_password?: scalar|Param|null, // Default: null
|
||||||
|
* extra_fields?: list<scalar|Param|null>,
|
||||||
|
* default_roles?: string|list<scalar|Param|null>,
|
||||||
|
* role_fetcher?: scalar|Param|null, // Default: null
|
||||||
|
* uid_key?: scalar|Param|null, // Default: "sAMAccountName"
|
||||||
|
* filter?: scalar|Param|null, // Default: "({uid_key}={user_identifier})"
|
||||||
|
* password_attribute?: scalar|Param|null, // Default: null
|
||||||
|
* },
|
||||||
|
* }>,
|
||||||
|
* firewalls?: array<string, array{ // Default: []
|
||||||
|
* pattern?: scalar|Param|null,
|
||||||
|
* host?: scalar|Param|null,
|
||||||
|
* methods?: string|list<scalar|Param|null>,
|
||||||
|
* security?: bool|Param, // Default: true
|
||||||
|
* user_checker?: scalar|Param|null, // The UserChecker to use when authenticating users in this firewall. // Default: "security.user_checker"
|
||||||
|
* request_matcher?: scalar|Param|null,
|
||||||
|
* access_denied_url?: scalar|Param|null,
|
||||||
|
* access_denied_handler?: scalar|Param|null,
|
||||||
|
* entry_point?: scalar|Param|null, // An enabled authenticator name or a service id that implements "Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface".
|
||||||
|
* provider?: scalar|Param|null,
|
||||||
|
* stateless?: bool|Param, // Default: false
|
||||||
|
* lazy?: bool|Param, // Default: false
|
||||||
|
* context?: scalar|Param|null,
|
||||||
|
* logout?: array{
|
||||||
|
* enable_csrf?: bool|Param|null, // Default: null
|
||||||
|
* csrf_token_id?: scalar|Param|null, // Default: "logout"
|
||||||
|
* csrf_parameter?: scalar|Param|null, // Default: "_csrf_token"
|
||||||
|
* csrf_token_manager?: scalar|Param|null,
|
||||||
|
* path?: scalar|Param|null, // Default: "/logout"
|
||||||
|
* target?: scalar|Param|null, // Default: "/"
|
||||||
|
* invalidate_session?: bool|Param, // Default: true
|
||||||
|
* clear_site_data?: string|list<"*"|"cache"|"cookies"|"storage"|"clientHints"|"executionContexts"|"prefetchCache"|"prerenderCache"|Param>,
|
||||||
|
* delete_cookies?: string|array<string, array{ // Default: []
|
||||||
|
* path?: scalar|Param|null, // Default: null
|
||||||
|
* domain?: scalar|Param|null, // Default: null
|
||||||
|
* secure?: scalar|Param|null, // Default: false
|
||||||
|
* samesite?: scalar|Param|null, // Default: null
|
||||||
|
* partitioned?: scalar|Param|null, // Default: false
|
||||||
|
* }>,
|
||||||
|
* },
|
||||||
|
* switch_user?: array{
|
||||||
|
* provider?: scalar|Param|null,
|
||||||
|
* parameter?: scalar|Param|null, // Default: "_switch_user"
|
||||||
|
* role?: scalar|Param|null, // Default: "ROLE_ALLOWED_TO_SWITCH"
|
||||||
|
* target_route?: scalar|Param|null, // Default: null
|
||||||
|
* },
|
||||||
|
* required_badges?: list<scalar|Param|null>,
|
||||||
|
* custom_authenticators?: list<scalar|Param|null>,
|
||||||
|
* login_throttling?: array{
|
||||||
|
* limiter?: scalar|Param|null, // A service id implementing "Symfony\Component\HttpFoundation\RateLimiter\RequestRateLimiterInterface".
|
||||||
|
* max_attempts?: int|Param, // Default: 5
|
||||||
|
* interval?: scalar|Param|null, // Default: "1 minute"
|
||||||
|
* lock_factory?: scalar|Param|null, // The service ID of the lock factory used by the login rate limiter (or null to disable locking). // Default: null
|
||||||
|
* cache_pool?: string|Param, // The cache pool to use for storing the limiter state // Default: "cache.rate_limiter"
|
||||||
|
* storage_service?: string|Param, // The service ID of a custom storage implementation, this precedes any configured "cache_pool" // Default: null
|
||||||
|
* },
|
||||||
|
* x509?: array{
|
||||||
|
* provider?: scalar|Param|null,
|
||||||
|
* user?: scalar|Param|null, // Default: "SSL_CLIENT_S_DN_Email"
|
||||||
|
* credentials?: scalar|Param|null, // Default: "SSL_CLIENT_S_DN"
|
||||||
|
* user_identifier?: scalar|Param|null, // Default: "emailAddress"
|
||||||
|
* },
|
||||||
|
* remote_user?: array{
|
||||||
|
* provider?: scalar|Param|null,
|
||||||
|
* user?: scalar|Param|null, // Default: "REMOTE_USER"
|
||||||
|
* },
|
||||||
|
* login_link?: array{
|
||||||
|
* check_route?: scalar|Param|null, // Route that will validate the login link - e.g. "app_login_link_verify".
|
||||||
|
* check_post_only?: scalar|Param|null, // If true, only HTTP POST requests to "check_route" will be handled by the authenticator. // Default: false
|
||||||
|
* signature_properties?: list<scalar|Param|null>,
|
||||||
|
* lifetime?: int|Param, // The lifetime of the login link in seconds. // Default: 600
|
||||||
|
* max_uses?: int|Param, // Max number of times a login link can be used - null means unlimited within lifetime. // Default: null
|
||||||
|
* used_link_cache?: scalar|Param|null, // Cache service id used to expired links of max_uses is set.
|
||||||
|
* success_handler?: scalar|Param|null, // A service id that implements Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface.
|
||||||
|
* failure_handler?: scalar|Param|null, // A service id that implements Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface.
|
||||||
|
* provider?: scalar|Param|null, // The user provider to load users from.
|
||||||
|
* secret?: scalar|Param|null, // Default: "%kernel.secret%"
|
||||||
|
* always_use_default_target_path?: bool|Param, // Default: false
|
||||||
|
* default_target_path?: scalar|Param|null, // Default: "/"
|
||||||
|
* login_path?: scalar|Param|null, // Default: "/login"
|
||||||
|
* target_path_parameter?: scalar|Param|null, // Default: "_target_path"
|
||||||
|
* use_referer?: bool|Param, // Default: false
|
||||||
|
* failure_path?: scalar|Param|null, // Default: null
|
||||||
|
* failure_forward?: bool|Param, // Default: false
|
||||||
|
* failure_path_parameter?: scalar|Param|null, // Default: "_failure_path"
|
||||||
|
* },
|
||||||
|
* form_login?: array{
|
||||||
|
* provider?: scalar|Param|null,
|
||||||
|
* remember_me?: bool|Param, // Default: true
|
||||||
|
* success_handler?: scalar|Param|null,
|
||||||
|
* failure_handler?: scalar|Param|null,
|
||||||
|
* check_path?: scalar|Param|null, // Default: "/login_check"
|
||||||
|
* use_forward?: bool|Param, // Default: false
|
||||||
|
* login_path?: scalar|Param|null, // Default: "/login"
|
||||||
|
* username_parameter?: scalar|Param|null, // Default: "_username"
|
||||||
|
* password_parameter?: scalar|Param|null, // Default: "_password"
|
||||||
|
* csrf_parameter?: scalar|Param|null, // Default: "_csrf_token"
|
||||||
|
* csrf_token_id?: scalar|Param|null, // Default: "authenticate"
|
||||||
|
* enable_csrf?: bool|Param, // Default: false
|
||||||
|
* post_only?: bool|Param, // Default: true
|
||||||
|
* form_only?: bool|Param, // Default: false
|
||||||
|
* always_use_default_target_path?: bool|Param, // Default: false
|
||||||
|
* default_target_path?: scalar|Param|null, // Default: "/"
|
||||||
|
* target_path_parameter?: scalar|Param|null, // Default: "_target_path"
|
||||||
|
* use_referer?: bool|Param, // Default: false
|
||||||
|
* failure_path?: scalar|Param|null, // Default: null
|
||||||
|
* failure_forward?: bool|Param, // Default: false
|
||||||
|
* failure_path_parameter?: scalar|Param|null, // Default: "_failure_path"
|
||||||
|
* },
|
||||||
|
* form_login_ldap?: array{
|
||||||
|
* provider?: scalar|Param|null,
|
||||||
|
* remember_me?: bool|Param, // Default: true
|
||||||
|
* success_handler?: scalar|Param|null,
|
||||||
|
* failure_handler?: scalar|Param|null,
|
||||||
|
* check_path?: scalar|Param|null, // Default: "/login_check"
|
||||||
|
* use_forward?: bool|Param, // Default: false
|
||||||
|
* login_path?: scalar|Param|null, // Default: "/login"
|
||||||
|
* username_parameter?: scalar|Param|null, // Default: "_username"
|
||||||
|
* password_parameter?: scalar|Param|null, // Default: "_password"
|
||||||
|
* csrf_parameter?: scalar|Param|null, // Default: "_csrf_token"
|
||||||
|
* csrf_token_id?: scalar|Param|null, // Default: "authenticate"
|
||||||
|
* enable_csrf?: bool|Param, // Default: false
|
||||||
|
* post_only?: bool|Param, // Default: true
|
||||||
|
* form_only?: bool|Param, // Default: false
|
||||||
|
* always_use_default_target_path?: bool|Param, // Default: false
|
||||||
|
* default_target_path?: scalar|Param|null, // Default: "/"
|
||||||
|
* target_path_parameter?: scalar|Param|null, // Default: "_target_path"
|
||||||
|
* use_referer?: bool|Param, // Default: false
|
||||||
|
* failure_path?: scalar|Param|null, // Default: null
|
||||||
|
* failure_forward?: bool|Param, // Default: false
|
||||||
|
* failure_path_parameter?: scalar|Param|null, // Default: "_failure_path"
|
||||||
|
* service?: scalar|Param|null, // Default: "ldap"
|
||||||
|
* dn_string?: scalar|Param|null, // Default: "{user_identifier}"
|
||||||
|
* query_string?: scalar|Param|null,
|
||||||
|
* search_dn?: scalar|Param|null, // Default: ""
|
||||||
|
* search_password?: scalar|Param|null, // Default: ""
|
||||||
|
* },
|
||||||
|
* json_login?: array{
|
||||||
|
* provider?: scalar|Param|null,
|
||||||
|
* remember_me?: bool|Param, // Default: true
|
||||||
|
* success_handler?: scalar|Param|null,
|
||||||
|
* failure_handler?: scalar|Param|null,
|
||||||
|
* check_path?: scalar|Param|null, // Default: "/login_check"
|
||||||
|
* use_forward?: bool|Param, // Default: false
|
||||||
|
* login_path?: scalar|Param|null, // Default: "/login"
|
||||||
|
* username_path?: scalar|Param|null, // Default: "username"
|
||||||
|
* password_path?: scalar|Param|null, // Default: "password"
|
||||||
|
* },
|
||||||
|
* json_login_ldap?: array{
|
||||||
|
* provider?: scalar|Param|null,
|
||||||
|
* remember_me?: bool|Param, // Default: true
|
||||||
|
* success_handler?: scalar|Param|null,
|
||||||
|
* failure_handler?: scalar|Param|null,
|
||||||
|
* check_path?: scalar|Param|null, // Default: "/login_check"
|
||||||
|
* use_forward?: bool|Param, // Default: false
|
||||||
|
* login_path?: scalar|Param|null, // Default: "/login"
|
||||||
|
* username_path?: scalar|Param|null, // Default: "username"
|
||||||
|
* password_path?: scalar|Param|null, // Default: "password"
|
||||||
|
* service?: scalar|Param|null, // Default: "ldap"
|
||||||
|
* dn_string?: scalar|Param|null, // Default: "{user_identifier}"
|
||||||
|
* query_string?: scalar|Param|null,
|
||||||
|
* search_dn?: scalar|Param|null, // Default: ""
|
||||||
|
* search_password?: scalar|Param|null, // Default: ""
|
||||||
|
* },
|
||||||
|
* access_token?: array{
|
||||||
|
* provider?: scalar|Param|null,
|
||||||
|
* remember_me?: bool|Param, // Default: true
|
||||||
|
* success_handler?: scalar|Param|null,
|
||||||
|
* failure_handler?: scalar|Param|null,
|
||||||
|
* realm?: scalar|Param|null, // Default: null
|
||||||
|
* token_extractors?: string|list<scalar|Param|null>,
|
||||||
|
* token_handler?: string|array{
|
||||||
|
* id?: scalar|Param|null,
|
||||||
|
* oidc_user_info?: string|array{
|
||||||
|
* base_uri?: scalar|Param|null, // Base URI of the userinfo endpoint on the OIDC server, or the OIDC server URI to use the discovery (require "discovery" to be configured).
|
||||||
|
* discovery?: array{ // Enable the OIDC discovery.
|
||||||
|
* cache?: array{
|
||||||
|
* id?: scalar|Param|null, // Cache service id to use to cache the OIDC discovery configuration.
|
||||||
|
* },
|
||||||
|
* },
|
||||||
|
* claim?: scalar|Param|null, // Claim which contains the user identifier (e.g. sub, email, etc.). // Default: "sub"
|
||||||
|
* client?: scalar|Param|null, // HttpClient service id to use to call the OIDC server.
|
||||||
|
* },
|
||||||
|
* oidc?: array{
|
||||||
|
* discovery?: array{ // Enable the OIDC discovery.
|
||||||
|
* base_uri?: string|list<scalar|Param|null>,
|
||||||
|
* cache?: array{
|
||||||
|
* id?: scalar|Param|null, // Cache service id to use to cache the OIDC discovery configuration.
|
||||||
|
* },
|
||||||
|
* enforce_key_usage_verification?: bool|Param, // When enabled (default), only keys explicitly designated for signature (via "use":"sig" or a "key_ops" entry containing "sign"/"verify") are accepted. When disabled, keys without any usage designation are also accepted; keys explicitly restricted to encryption are still rejected. // Default: true
|
||||||
|
* },
|
||||||
|
* claim?: scalar|Param|null, // Claim which contains the user identifier (e.g.: sub, email..). // Default: "sub"
|
||||||
|
* audience?: scalar|Param|null, // Audience set in the token, for validation purpose.
|
||||||
|
* issuers?: list<scalar|Param|null>,
|
||||||
|
* algorithms?: list<scalar|Param|null>,
|
||||||
|
* keyset?: scalar|Param|null, // JSON-encoded JWKSet used to sign the token (must contain a list of valid public keys).
|
||||||
|
* encryption?: bool|array{
|
||||||
|
* enabled?: bool|Param, // Default: false
|
||||||
|
* enforce?: bool|Param, // When enabled, the token shall be encrypted. // Default: false
|
||||||
|
* algorithms?: list<scalar|Param|null>,
|
||||||
|
* keyset?: scalar|Param|null, // JSON-encoded JWKSet used to decrypt the token (must contain a list of valid private keys).
|
||||||
|
* },
|
||||||
|
* },
|
||||||
|
* cas?: array{
|
||||||
|
* validation_url?: scalar|Param|null, // CAS server validation URL
|
||||||
|
* prefix?: scalar|Param|null, // CAS prefix // Default: "cas"
|
||||||
|
* http_client?: scalar|Param|null, // HTTP Client service // Default: null
|
||||||
|
* },
|
||||||
|
* oauth2?: scalar|Param|null,
|
||||||
|
* },
|
||||||
|
* },
|
||||||
|
* http_basic?: array{
|
||||||
|
* provider?: scalar|Param|null,
|
||||||
|
* realm?: scalar|Param|null, // Default: "Secured Area"
|
||||||
|
* },
|
||||||
|
* http_basic_ldap?: array{
|
||||||
|
* provider?: scalar|Param|null,
|
||||||
|
* realm?: scalar|Param|null, // Default: "Secured Area"
|
||||||
|
* service?: scalar|Param|null, // Default: "ldap"
|
||||||
|
* dn_string?: scalar|Param|null, // Default: "{user_identifier}"
|
||||||
|
* query_string?: scalar|Param|null,
|
||||||
|
* search_dn?: scalar|Param|null, // Default: ""
|
||||||
|
* search_password?: scalar|Param|null, // Default: ""
|
||||||
|
* },
|
||||||
|
* remember_me?: array{
|
||||||
|
* secret?: scalar|Param|null, // Default: "%kernel.secret%"
|
||||||
|
* service?: scalar|Param|null,
|
||||||
|
* user_providers?: string|list<scalar|Param|null>,
|
||||||
|
* catch_exceptions?: bool|Param, // Default: true
|
||||||
|
* signature_properties?: list<scalar|Param|null>,
|
||||||
|
* token_provider?: string|array{
|
||||||
|
* service?: scalar|Param|null, // The service ID of a custom remember-me token provider.
|
||||||
|
* doctrine?: bool|array{
|
||||||
|
* enabled?: bool|Param, // Default: false
|
||||||
|
* connection?: scalar|Param|null, // Default: null
|
||||||
|
* },
|
||||||
|
* },
|
||||||
|
* token_verifier?: scalar|Param|null, // The service ID of a custom rememberme token verifier.
|
||||||
|
* name?: scalar|Param|null, // Default: "REMEMBERME"
|
||||||
|
* lifetime?: int|Param, // Default: 31536000
|
||||||
|
* path?: scalar|Param|null, // Default: "/"
|
||||||
|
* domain?: scalar|Param|null, // Default: null
|
||||||
|
* secure?: true|false|"auto"|Param, // Default: false
|
||||||
|
* httponly?: bool|Param, // Default: true
|
||||||
|
* samesite?: null|"lax"|"strict"|"none"|Param, // Default: null
|
||||||
|
* always_remember_me?: bool|Param, // Default: false
|
||||||
|
* remember_me_parameter?: scalar|Param|null, // Default: "_remember_me"
|
||||||
|
* },
|
||||||
|
* }>,
|
||||||
|
* access_control?: list<array{ // Default: []
|
||||||
|
* request_matcher?: scalar|Param|null, // Default: null
|
||||||
|
* requires_channel?: scalar|Param|null, // Default: null
|
||||||
|
* path?: scalar|Param|null, // Use the urldecoded format. // Default: null
|
||||||
|
* host?: scalar|Param|null, // Default: null
|
||||||
|
* port?: int|Param, // Default: null
|
||||||
|
* ips?: string|list<scalar|Param|null>,
|
||||||
|
* attributes?: array<string, scalar|Param|null>,
|
||||||
|
* route?: scalar|Param|null, // Default: null
|
||||||
|
* methods?: string|list<scalar|Param|null>,
|
||||||
|
* allow_if?: scalar|Param|null, // Default: null
|
||||||
|
* roles?: string|list<scalar|Param|null>,
|
||||||
|
* }>,
|
||||||
|
* role_hierarchy?: array<string, string|list<scalar|Param|null>>,
|
||||||
|
* }
|
||||||
|
* @psalm-type TwigConfig = array{
|
||||||
|
* form_themes?: list<scalar|Param|null>,
|
||||||
|
* globals?: array<string, array{ // Default: []
|
||||||
|
* id?: scalar|Param|null,
|
||||||
|
* type?: scalar|Param|null,
|
||||||
|
* value?: mixed,
|
||||||
|
* }>,
|
||||||
|
* autoescape_service?: scalar|Param|null, // Default: null
|
||||||
|
* autoescape_service_method?: scalar|Param|null, // Default: null
|
||||||
|
* cache?: scalar|Param|null, // Default: true
|
||||||
|
* charset?: scalar|Param|null, // Default: "%kernel.charset%"
|
||||||
|
* debug?: bool|Param, // Default: "%kernel.debug%"
|
||||||
|
* strict_variables?: bool|Param, // Default: "%kernel.debug%"
|
||||||
|
* auto_reload?: scalar|Param|null,
|
||||||
|
* optimizations?: int|Param,
|
||||||
|
* default_path?: scalar|Param|null, // The default path used to load templates. // Default: "%kernel.project_dir%/templates"
|
||||||
|
* file_name_pattern?: string|list<scalar|Param|null>,
|
||||||
|
* paths?: array<string, mixed>,
|
||||||
|
* date?: array{ // The default format options used by the date filter.
|
||||||
|
* format?: scalar|Param|null, // Default: "F j, Y H:i"
|
||||||
|
* interval_format?: scalar|Param|null, // Default: "%d days"
|
||||||
|
* timezone?: scalar|Param|null, // The timezone used when formatting dates, when set to null, the timezone returned by date_default_timezone_get() is used. // Default: null
|
||||||
|
* },
|
||||||
|
* number_format?: array{ // The default format options for the number_format filter.
|
||||||
|
* decimals?: int|Param, // Default: 0
|
||||||
|
* decimal_point?: scalar|Param|null, // Default: "."
|
||||||
|
* thousands_separator?: scalar|Param|null, // Default: ","
|
||||||
|
* },
|
||||||
|
* mailer?: array{
|
||||||
|
* html_to_text_converter?: scalar|Param|null, // A service implementing the "Symfony\Component\Mime\HtmlToTextConverter\HtmlToTextConverterInterface". // Default: null
|
||||||
|
* },
|
||||||
|
* }
|
||||||
|
* @psalm-type WebProfilerConfig = array{
|
||||||
|
* toolbar?: bool|array{ // Profiler toolbar configuration
|
||||||
|
* enabled?: bool|Param, // Default: false
|
||||||
|
* ajax_replace?: bool|Param, // Replace toolbar on AJAX requests // Default: false
|
||||||
|
* },
|
||||||
|
* intercept_redirects?: bool|Param, // Default: false
|
||||||
|
* excluded_ajax_paths?: scalar|Param|null, // Default: "^/((index|app(_[\\w]+)?)\\.php/)?_wdt"
|
||||||
|
* }
|
||||||
* @psalm-type ConfigType = array{
|
* @psalm-type ConfigType = array{
|
||||||
* imports?: ImportsConfig,
|
* imports?: ImportsConfig,
|
||||||
* parameters?: ParametersConfig,
|
* parameters?: ParametersConfig,
|
||||||
* services?: ServicesConfig,
|
* services?: ServicesConfig,
|
||||||
* framework?: FrameworkConfig,
|
* framework?: FrameworkConfig,
|
||||||
|
* doctrine?: DoctrineConfig,
|
||||||
|
* doctrine_migrations?: DoctrineMigrationsConfig,
|
||||||
|
* security?: SecurityConfig,
|
||||||
|
* twig?: TwigConfig,
|
||||||
* "when@dev"?: array{
|
* "when@dev"?: array{
|
||||||
* imports?: ImportsConfig,
|
* imports?: ImportsConfig,
|
||||||
* parameters?: ParametersConfig,
|
* parameters?: ParametersConfig,
|
||||||
* services?: ServicesConfig,
|
* services?: ServicesConfig,
|
||||||
* framework?: FrameworkConfig,
|
* framework?: FrameworkConfig,
|
||||||
|
* doctrine?: DoctrineConfig,
|
||||||
|
* doctrine_migrations?: DoctrineMigrationsConfig,
|
||||||
|
* maker?: MakerConfig,
|
||||||
|
* security?: SecurityConfig,
|
||||||
|
* twig?: TwigConfig,
|
||||||
|
* web_profiler?: WebProfilerConfig,
|
||||||
* },
|
* },
|
||||||
* "when@prod"?: array{
|
* "when@prod"?: array{
|
||||||
* imports?: ImportsConfig,
|
* imports?: ImportsConfig,
|
||||||
* parameters?: ParametersConfig,
|
* parameters?: ParametersConfig,
|
||||||
* services?: ServicesConfig,
|
* services?: ServicesConfig,
|
||||||
* framework?: FrameworkConfig,
|
* framework?: FrameworkConfig,
|
||||||
|
* doctrine?: DoctrineConfig,
|
||||||
|
* doctrine_migrations?: DoctrineMigrationsConfig,
|
||||||
|
* security?: SecurityConfig,
|
||||||
|
* twig?: TwigConfig,
|
||||||
* },
|
* },
|
||||||
* "when@test"?: array{
|
* "when@test"?: array{
|
||||||
* imports?: ImportsConfig,
|
* imports?: ImportsConfig,
|
||||||
* parameters?: ParametersConfig,
|
* parameters?: ParametersConfig,
|
||||||
* services?: ServicesConfig,
|
* services?: ServicesConfig,
|
||||||
* framework?: FrameworkConfig,
|
* framework?: FrameworkConfig,
|
||||||
|
* doctrine?: DoctrineConfig,
|
||||||
|
* doctrine_migrations?: DoctrineMigrationsConfig,
|
||||||
|
* security?: SecurityConfig,
|
||||||
|
* twig?: TwigConfig,
|
||||||
|
* web_profiler?: WebProfilerConfig,
|
||||||
* },
|
* },
|
||||||
* ...<string, ExtensionType|array{ // extra keys must follow the when@%env% pattern or match an extension alias
|
* ...<string, ExtensionType|array{ // extra keys must follow the when@%env% pattern or match an extension alias
|
||||||
* imports?: ImportsConfig,
|
* imports?: ImportsConfig,
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
_security_logout:
|
||||||
|
resource: security.route_loader.logout
|
||||||
|
type: service
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
when@dev:
|
||||||
|
web_profiler_wdt:
|
||||||
|
resource: '@WebProfilerBundle/Resources/config/routing/wdt.php'
|
||||||
|
prefix: /_wdt
|
||||||
|
|
||||||
|
web_profiler_profiler:
|
||||||
|
resource: '@WebProfilerBundle/Resources/config/routing/profiler.php'
|
||||||
|
prefix: /_profiler
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: symfony
|
||||||
|
namespace: symfony
|
||||||
|
labels:
|
||||||
|
app: symfony
|
||||||
|
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: symfony
|
||||||
|
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: symfony
|
||||||
|
|
||||||
|
spec:
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/hostname: cluster-01
|
||||||
|
|
||||||
|
containers:
|
||||||
|
- name: symfony
|
||||||
|
image: symfony-k3s:dev-2
|
||||||
|
imagePullPolicy: Never
|
||||||
|
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 8080
|
||||||
|
|
||||||
|
env:
|
||||||
|
- name: APP_ENV
|
||||||
|
value: prod
|
||||||
|
|
||||||
|
- name: APP_DEBUG
|
||||||
|
value: "0"
|
||||||
|
|
||||||
|
- name: SERVER_NAME
|
||||||
|
value: ":8080"
|
||||||
|
|
||||||
|
- name: DATABASE_URL
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: symfony-database
|
||||||
|
key: DATABASE_URL
|
||||||
|
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
port: http
|
||||||
|
initialDelaySeconds: 3
|
||||||
|
periodSeconds: 10
|
||||||
|
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
port: http
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 20
|
||||||
|
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 50m
|
||||||
|
memory: 64Mi
|
||||||
|
|
||||||
|
limits:
|
||||||
|
cpu: "1"
|
||||||
|
memory: 512Mi
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: symfony
|
||||||
|
namespace: symfony
|
||||||
|
|
||||||
|
spec:
|
||||||
|
ingressClassName: traefik
|
||||||
|
|
||||||
|
rules:
|
||||||
|
- host: tasks.jorendegraaf.eu
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: symfony
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: mariadb
|
||||||
|
namespace: symfony
|
||||||
|
spec:
|
||||||
|
clusterIP: None
|
||||||
|
|
||||||
|
selector:
|
||||||
|
app: mariadb
|
||||||
|
|
||||||
|
ports:
|
||||||
|
- name: mysql
|
||||||
|
port: 3306
|
||||||
|
targetPort: mysql
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: mariadb
|
||||||
|
namespace: symfony
|
||||||
|
|
||||||
|
spec:
|
||||||
|
serviceName: mariadb
|
||||||
|
replicas: 1
|
||||||
|
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: mariadb
|
||||||
|
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: mariadb
|
||||||
|
|
||||||
|
spec:
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/hostname: cluster-01
|
||||||
|
|
||||||
|
containers:
|
||||||
|
- name: mariadb
|
||||||
|
image: mariadb:11.8
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
ports:
|
||||||
|
- name: mysql
|
||||||
|
containerPort: 3306
|
||||||
|
|
||||||
|
env:
|
||||||
|
- name: MARIADB_ROOT_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: mariadb-credentials
|
||||||
|
key: root-password
|
||||||
|
|
||||||
|
- name: MARIADB_DATABASE
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: mariadb-credentials
|
||||||
|
key: database
|
||||||
|
|
||||||
|
- name: MARIADB_USER
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: mariadb-credentials
|
||||||
|
key: username
|
||||||
|
|
||||||
|
- name: MARIADB_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: mariadb-credentials
|
||||||
|
key: password
|
||||||
|
|
||||||
|
volumeMounts:
|
||||||
|
- name: database
|
||||||
|
mountPath: /var/lib/mysql
|
||||||
|
|
||||||
|
readinessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- healthcheck.sh
|
||||||
|
- --connect
|
||||||
|
- --innodb_initialized
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 5
|
||||||
|
timeoutSeconds: 3
|
||||||
|
failureThreshold: 12
|
||||||
|
|
||||||
|
livenessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- healthcheck.sh
|
||||||
|
- --connect
|
||||||
|
- --innodb_initialized
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 6
|
||||||
|
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 256Mi
|
||||||
|
|
||||||
|
limits:
|
||||||
|
cpu: "1"
|
||||||
|
memory: 1Gi
|
||||||
|
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: database
|
||||||
|
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
|
||||||
|
storageClassName: local-path
|
||||||
|
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 10Gi
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: symfony
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: symfony
|
||||||
|
namespace: symfony
|
||||||
|
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: symfony
|
||||||
|
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 80
|
||||||
|
targetPort: http
|
||||||
|
|
||||||
|
type: ClusterIP
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
|
*/
|
||||||
|
final class Version20260725200446 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this up() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('CREATE TABLE `user` (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_IDENTIFIER_EMAIL (email), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('DROP TABLE `user`');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Controller;
|
||||||
|
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
|
||||||
|
final class HomeController
|
||||||
|
{
|
||||||
|
#[Route('/', name: 'app_home', methods: ['GET'])]
|
||||||
|
public function index(): Response
|
||||||
|
{
|
||||||
|
return new Response(
|
||||||
|
'<h1>Symfony is running in FrankenPHP 🎉</h1>'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controller;
|
||||||
|
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
||||||
|
|
||||||
|
class SecurityController extends AbstractController
|
||||||
|
{
|
||||||
|
#[Route(path: '/login', name: 'app_login')]
|
||||||
|
public function login(AuthenticationUtils $authenticationUtils): Response
|
||||||
|
{
|
||||||
|
// get the login error if there is one
|
||||||
|
$error = $authenticationUtils->getLastAuthenticationError();
|
||||||
|
|
||||||
|
// last username entered by the user
|
||||||
|
$lastUsername = $authenticationUtils->getLastUsername();
|
||||||
|
|
||||||
|
return $this->render('security/login.html.twig', [
|
||||||
|
'last_username' => $lastUsername,
|
||||||
|
'error' => $error,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[Route(path: '/logout', name: 'app_logout')]
|
||||||
|
public function logout(): void
|
||||||
|
{
|
||||||
|
throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use App\Repository\UserRepository;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||||
|
use Symfony\Component\Security\Core\User\UserInterface;
|
||||||
|
|
||||||
|
#[ORM\Entity(repositoryClass: UserRepository::class)]
|
||||||
|
#[ORM\Table(name: '`user`')]
|
||||||
|
#[ORM\UniqueConstraint(name: 'UNIQ_IDENTIFIER_EMAIL', fields: ['email'])]
|
||||||
|
class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?int $id = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 180)]
|
||||||
|
private ?string $email = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var list<string> The user roles
|
||||||
|
*/
|
||||||
|
#[ORM\Column]
|
||||||
|
private array $roles = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string The hashed password
|
||||||
|
*/
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?string $password = null;
|
||||||
|
|
||||||
|
public function getId(): ?int
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getEmail(): ?string
|
||||||
|
{
|
||||||
|
return $this->email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setEmail(string $email): static
|
||||||
|
{
|
||||||
|
$this->email = $email;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A visual identifier that represents this user.
|
||||||
|
*
|
||||||
|
* @see UserInterface
|
||||||
|
*/
|
||||||
|
public function getUserIdentifier(): string
|
||||||
|
{
|
||||||
|
return (string) $this->email;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see UserInterface
|
||||||
|
*/
|
||||||
|
public function getRoles(): array
|
||||||
|
{
|
||||||
|
$roles = $this->roles;
|
||||||
|
// guarantee every user at least has ROLE_USER
|
||||||
|
$roles[] = 'ROLE_USER';
|
||||||
|
|
||||||
|
return array_unique($roles);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param list<string> $roles
|
||||||
|
*/
|
||||||
|
public function setRoles(array $roles): static
|
||||||
|
{
|
||||||
|
$this->roles = $roles;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see PasswordAuthenticatedUserInterface
|
||||||
|
*/
|
||||||
|
public function getPassword(): ?string
|
||||||
|
{
|
||||||
|
return $this->password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setPassword(string $password): static
|
||||||
|
{
|
||||||
|
$this->password = $password;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ensure the session doesn't contain actual password hashes by CRC32C-hashing them, as supported since Symfony 7.3.
|
||||||
|
*/
|
||||||
|
public function __serialize(): array
|
||||||
|
{
|
||||||
|
$data = (array) $this;
|
||||||
|
$data["\0".self::class."\0password"] = hash('crc32c', $this->password);
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repository;
|
||||||
|
|
||||||
|
use App\Entity\User;
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
|
||||||
|
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||||
|
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends ServiceEntityRepository<User>
|
||||||
|
*/
|
||||||
|
class UserRepository extends ServiceEntityRepository implements PasswordUpgraderInterface
|
||||||
|
{
|
||||||
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, User::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to upgrade (rehash) the user's password automatically over time.
|
||||||
|
*/
|
||||||
|
public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void
|
||||||
|
{
|
||||||
|
if (!$user instanceof User) {
|
||||||
|
throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', $user::class));
|
||||||
|
}
|
||||||
|
|
||||||
|
$user->setPassword($newHashedPassword);
|
||||||
|
$this->getEntityManager()->persist($user);
|
||||||
|
$this->getEntityManager()->flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * @return User[] Returns an array of User objects
|
||||||
|
// */
|
||||||
|
// public function findByExampleField($value): array
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('u')
|
||||||
|
// ->andWhere('u.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->orderBy('u.id', 'ASC')
|
||||||
|
// ->setMaxResults(10)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function findOneBySomeField($value): ?User
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('u')
|
||||||
|
// ->andWhere('u.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getOneOrNullResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
}
|
||||||
@@ -1,4 +1,40 @@
|
|||||||
{
|
{
|
||||||
|
"doctrine/deprecations": {
|
||||||
|
"version": "1.1",
|
||||||
|
"recipe": {
|
||||||
|
"repo": "github.com/symfony/recipes",
|
||||||
|
"branch": "main",
|
||||||
|
"version": "1.0",
|
||||||
|
"ref": "fdd756167454623e21f1d769c5b814b243782a67"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"doctrine/doctrine-bundle": {
|
||||||
|
"version": "3.3",
|
||||||
|
"recipe": {
|
||||||
|
"repo": "github.com/symfony/recipes",
|
||||||
|
"branch": "main",
|
||||||
|
"version": "3.0",
|
||||||
|
"ref": "d39a3bd844edfe90c20ae520b804a3bf4f82b4ad"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"config/packages/doctrine.yaml",
|
||||||
|
"src/Entity/.gitignore",
|
||||||
|
"src/Repository/.gitignore"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"doctrine/doctrine-migrations-bundle": {
|
||||||
|
"version": "4.0",
|
||||||
|
"recipe": {
|
||||||
|
"repo": "github.com/symfony/recipes",
|
||||||
|
"branch": "main",
|
||||||
|
"version": "3.1",
|
||||||
|
"ref": "1d01ec03c6ecbd67c3375c5478c9a423ae5d6a33"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"config/packages/doctrine_migrations.yaml",
|
||||||
|
"migrations/.gitignore"
|
||||||
|
]
|
||||||
|
},
|
||||||
"symfony/console": {
|
"symfony/console": {
|
||||||
"version": "8.1",
|
"version": "8.1",
|
||||||
"recipe": {
|
"recipe": {
|
||||||
@@ -44,6 +80,27 @@
|
|||||||
".editorconfig"
|
".editorconfig"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"symfony/maker-bundle": {
|
||||||
|
"version": "1.67",
|
||||||
|
"recipe": {
|
||||||
|
"repo": "github.com/symfony/recipes",
|
||||||
|
"branch": "main",
|
||||||
|
"version": "1.0",
|
||||||
|
"ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"symfony/property-info": {
|
||||||
|
"version": "8.1",
|
||||||
|
"recipe": {
|
||||||
|
"repo": "github.com/symfony/recipes",
|
||||||
|
"branch": "main",
|
||||||
|
"version": "7.3",
|
||||||
|
"ref": "dae70df71978ae9226ae915ffd5fad817f5ca1f7"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"config/packages/property_info.yaml"
|
||||||
|
]
|
||||||
|
},
|
||||||
"symfony/routing": {
|
"symfony/routing": {
|
||||||
"version": "8.1",
|
"version": "8.1",
|
||||||
"recipe": {
|
"recipe": {
|
||||||
@@ -56,5 +113,44 @@
|
|||||||
"config/packages/routing.yaml",
|
"config/packages/routing.yaml",
|
||||||
"config/routes.yaml"
|
"config/routes.yaml"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"symfony/security-bundle": {
|
||||||
|
"version": "8.1",
|
||||||
|
"recipe": {
|
||||||
|
"repo": "github.com/symfony/recipes",
|
||||||
|
"branch": "main",
|
||||||
|
"version": "7.4",
|
||||||
|
"ref": "c42fee7802181cdd50f61b8622715829f5d2335c"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"config/packages/security.yaml",
|
||||||
|
"config/routes/security.yaml"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"symfony/twig-bundle": {
|
||||||
|
"version": "8.1",
|
||||||
|
"recipe": {
|
||||||
|
"repo": "github.com/symfony/recipes",
|
||||||
|
"branch": "main",
|
||||||
|
"version": "6.4",
|
||||||
|
"ref": "06dacf16872358cb1f2494e089070ff2d045233a"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"config/packages/twig.yaml",
|
||||||
|
"templates/base.html.twig"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"symfony/web-profiler-bundle": {
|
||||||
|
"version": "8.1",
|
||||||
|
"recipe": {
|
||||||
|
"repo": "github.com/symfony/recipes",
|
||||||
|
"branch": "main",
|
||||||
|
"version": "8.1",
|
||||||
|
"ref": "6bdd46f712bbed33a27130b6e055391cb1ab73d9"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"config/packages/web_profiler.yaml",
|
||||||
|
"config/routes/web_profiler.yaml"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>{% block title %}Welcome!{% endblock %}</title>
|
||||||
|
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
|
||||||
|
{% block stylesheets %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block javascripts %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% set frankenphp_hot_reload = app.request.server.get('FRANKENPHP_HOT_RELOAD') %}
|
||||||
|
{% if frankenphp_hot_reload %}
|
||||||
|
<meta name="frankenphp-hot-reload:url" content="{{ frankenphp_hot_reload }}">
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/idiomorph"></script>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/frankenphp-hot-reload/+esm" type="module"></script>
|
||||||
|
{% endif %}
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
{% block body %}{% endblock %}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Log in!{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<form method="post">
|
||||||
|
{% if error %}
|
||||||
|
<div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if app.user %}
|
||||||
|
<div class="mb-3">
|
||||||
|
You are logged in as {{ app.user.userIdentifier }}, <a href="{{ logout_path() }}">Logout</a>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<h1 class="h3 mb-3 font-weight-normal">Please sign in</h1>
|
||||||
|
<label for="username">Email</label>
|
||||||
|
<input type="email" value="{{ last_username }}" name="_username" id="username" class="form-control" autocomplete="email" required autofocus>
|
||||||
|
<label for="password">Password</label>
|
||||||
|
<input type="password" name="_password" id="password" class="form-control" autocomplete="current-password" required>
|
||||||
|
<input type="hidden" name="_csrf_token" data-controller="csrf-protection" value="{{ csrf_token('authenticate') }}">
|
||||||
|
|
||||||
|
{#
|
||||||
|
Uncomment this section and add a remember_me option below your firewall to activate remember me functionality.
|
||||||
|
See https://symfony.com/doc/current/security/remember_me.html
|
||||||
|
|
||||||
|
<div class="checkbox mb-3">
|
||||||
|
<input type="checkbox" name="_remember_me" id="_remember_me">
|
||||||
|
<label for="_remember_me">Remember me</label>
|
||||||
|
</div>
|
||||||
|
#}
|
||||||
|
|
||||||
|
<button class="btn btn-lg btn-primary" type="submit">
|
||||||
|
Sign in
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user