mirror of
https://github.com/symfony/recipes.git
synced 2026-09-11 23:26:27 +03:00
moved etc/ to config/ and web/ to public/
This commit is contained in:
+16
-16
@@ -25,9 +25,9 @@ The following example shows the real directory structure of some Symfony recipes
|
|||||||
manifest.json
|
manifest.json
|
||||||
framework-bundle/
|
framework-bundle/
|
||||||
3.3/
|
3.3/
|
||||||
etc/
|
config/
|
||||||
|
public/
|
||||||
src/
|
src/
|
||||||
web/
|
|
||||||
manifest.json
|
manifest.json
|
||||||
requirements-checker/
|
requirements-checker/
|
||||||
1.0/
|
1.0/
|
||||||
@@ -96,7 +96,7 @@ The previous recipe is transformed into the following PHP code:
|
|||||||
|
|
||||||
.. code-block:: php
|
.. code-block:: php
|
||||||
|
|
||||||
// etc/bundles.php
|
// config/bundles.php
|
||||||
return [
|
return [
|
||||||
'Symfony\Bundle\DebugBundle\DebugBundle' => ['dev' => true, 'test' => true],
|
'Symfony\Bundle\DebugBundle\DebugBundle' => ['dev' => true, 'test' => true],
|
||||||
'Symfony\Bundle\MonologBundle\MonologBundle' => ['all' => true],
|
'Symfony\Bundle\MonologBundle\MonologBundle' => ['all' => true],
|
||||||
@@ -139,8 +139,8 @@ directory of the application:
|
|||||||
|
|
||||||
The ``%BIN_DIR%`` string is a special value that it's turned into the absolute
|
The ``%BIN_DIR%`` string is a special value that it's turned into the absolute
|
||||||
path of the binaries directory of the Symfony application. These are the special
|
path of the binaries directory of the Symfony application. These are the special
|
||||||
variables available: ``%BIN_DIR%``, ``%CONF_DIR%``, ``%ETC_DIR%``, ``%SRC_DIR%``
|
variables available: ``%BIN_DIR%``, ``%CONF_DIR%``, ``%CONFIG_DIR%``, ``%SRC_DIR%``
|
||||||
``%VAR_DIR%`` and ``%WEB_DIR%``. You can also access to any variable defined in
|
``%VAR_DIR%`` and ``%PUBLIC_DIR%``. You can also access to any variable defined in
|
||||||
the ``extra`` section of your ``composer.json`` file:
|
the ``extra`` section of your ``composer.json`` file:
|
||||||
|
|
||||||
.. code-block:: json
|
.. code-block:: json
|
||||||
@@ -167,7 +167,7 @@ files and directories:
|
|||||||
.. code-block:: json
|
.. code-block:: json
|
||||||
|
|
||||||
"copy-from-recipe": {
|
"copy-from-recipe": {
|
||||||
"etc/": "%ETC_DIR%/",
|
"config/": "%CONFIG_DIR%/",
|
||||||
"src/": "%SRC_DIR%/"
|
"src/": "%SRC_DIR%/"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@ script (``php-script`` for PHP scripts, ``script`` for any shell script and
|
|||||||
"composer-scripts": {
|
"composer-scripts": {
|
||||||
"vendor/bin/security-checker security:check": "php-script",
|
"vendor/bin/security-checker security:check": "php-script",
|
||||||
"make cache-warmup": "script",
|
"make cache-warmup": "script",
|
||||||
"assets:install --symlink --relative %WEB_DIR%": "symfony-cmd"
|
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,9 +249,9 @@ each line):
|
|||||||
{
|
{
|
||||||
"gitignore": [
|
"gitignore": [
|
||||||
".env",
|
".env",
|
||||||
|
"/public/bundles/",
|
||||||
"/var/",
|
"/var/",
|
||||||
"/vendor/",
|
"/vendor/"
|
||||||
"/web/bundles/"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -292,7 +292,7 @@ the recipe:
|
|||||||
* YAML files suffix must be ``.yaml``, not ``.yml``;
|
* YAML files suffix must be ``.yaml``, not ``.yml``;
|
||||||
* YAML files must be valid;
|
* YAML files must be valid;
|
||||||
* YAML files must use 4 space indentations;
|
* YAML files must use 4 space indentations;
|
||||||
* YAML files under etc/packages must not define a "parameters" section;
|
* YAML files under config/packages must not define a "parameters" section;
|
||||||
* JSON files must be valid;
|
* JSON files must be valid;
|
||||||
* JSON files must use 4 space indentations;
|
* JSON files must use 4 space indentations;
|
||||||
* Aliases are only supported in the main repository, not the contrib one;
|
* Aliases are only supported in the main repository, not the contrib one;
|
||||||
@@ -306,7 +306,7 @@ the recipe:
|
|||||||
* The package must have a registered bundle in the manifest if type is "symfony-bundle";
|
* The package must have a registered bundle in the manifest if type is "symfony-bundle";
|
||||||
* The package does not only register a bundle for all environments;
|
* The package does not only register a bundle for all environments;
|
||||||
* All text files should end with a newline;
|
* All text files should end with a newline;
|
||||||
* All configuration file names under ``etc`` should use the underscore notation;
|
* All configuration file names under ``config`` should use the underscore notation;
|
||||||
* All files are stored under a directory referenced by the "copy-from-recipe" section of "manifest.json"
|
* All files are stored under a directory referenced by the "copy-from-recipe" section of "manifest.json"
|
||||||
* The Symfony website must be referenced using HTTPs.
|
* The Symfony website must be referenced using HTTPs.
|
||||||
|
|
||||||
@@ -323,13 +323,13 @@ one used by ``symfony/framework-bundle``:
|
|||||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": ["all"]
|
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": ["all"]
|
||||||
},
|
},
|
||||||
"copy-from-recipe": {
|
"copy-from-recipe": {
|
||||||
"etc/": "%ETC_DIR%/",
|
"config/": "%CONFIG_DIR%/",
|
||||||
"src/": "%SRC_DIR%/",
|
"public/": "%PUBLIC_DIR%/",
|
||||||
"web/": "%WEB_DIR%/"
|
"src/": "%SRC_DIR%/"
|
||||||
},
|
},
|
||||||
"composer-scripts": {
|
"composer-scripts": {
|
||||||
"make cache-warmup": "script",
|
"make cache-warmup": "script",
|
||||||
"assets:install --symlink --relative %WEB_DIR%": "symfony-cmd"
|
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||||
},
|
},
|
||||||
"env": {
|
"env": {
|
||||||
"APP_ENV": "dev",
|
"APP_ENV": "dev",
|
||||||
@@ -338,9 +338,9 @@ one used by ``symfony/framework-bundle``:
|
|||||||
},
|
},
|
||||||
"gitignore": [
|
"gitignore": [
|
||||||
".env",
|
".env",
|
||||||
|
"/public/bundles/"
|
||||||
"/var/",
|
"/var/",
|
||||||
"/vendor/",
|
"/vendor/",
|
||||||
"/web/bundles/"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"ApiPlatform\\Core\\Bridge\\Symfony\\Bundle\\ApiPlatformBundle": ["all"]
|
"ApiPlatform\\Core\\Bridge\\Symfony\\Bundle\\ApiPlatformBundle": ["all"]
|
||||||
},
|
},
|
||||||
"copy-from-recipe": {
|
"copy-from-recipe": {
|
||||||
"etc/": "%ETC_DIR%/",
|
"config/": "%CONFIG_DIR%/",
|
||||||
"src/": "%SRC_DIR%/"
|
"src/": "%SRC_DIR%/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"Doctrine\\Bundle\\DoctrineBundle\\DoctrineBundle": ["all"]
|
"Doctrine\\Bundle\\DoctrineBundle\\DoctrineBundle": ["all"]
|
||||||
},
|
},
|
||||||
"copy-from-recipe": {
|
"copy-from-recipe": {
|
||||||
"etc/": "%ETC_DIR%/",
|
"config/": "%CONFIG_DIR%/",
|
||||||
"src/": "%SRC_DIR%/"
|
"src/": "%SRC_DIR%/"
|
||||||
},
|
},
|
||||||
"env": {
|
"env": {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"Doctrine\\Bundle\\MigrationsBundle\\DoctrineMigrationsBundle": ["all"]
|
"Doctrine\\Bundle\\MigrationsBundle\\DoctrineMigrationsBundle": ["all"]
|
||||||
},
|
},
|
||||||
"copy-from-recipe": {
|
"copy-from-recipe": {
|
||||||
"etc/": "%ETC_DIR%/",
|
"config/": "%CONFIG_DIR%/",
|
||||||
"src/": "%SRC_DIR%/"
|
"src/": "%SRC_DIR%/"
|
||||||
},
|
},
|
||||||
"aliases": ["doctrine-migrations", "migrations"]
|
"aliases": ["doctrine-migrations", "migrations"]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"copy-from-recipe": {
|
"copy-from-recipe": {
|
||||||
"etc/": "%ETC_DIR%/"
|
"config/": "%CONFIG_DIR%/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"JavierEguiluz\\Bundle\\EasyAdminBundle\\EasyAdminBundle": ["all"]
|
"JavierEguiluz\\Bundle\\EasyAdminBundle\\EasyAdminBundle": ["all"]
|
||||||
},
|
},
|
||||||
"copy-from-recipe": {
|
"copy-from-recipe": {
|
||||||
"etc/": "%ETC_DIR%/"
|
"config/": "%CONFIG_DIR%/"
|
||||||
},
|
},
|
||||||
"aliases": ["admin-gen", "admin-generator", "admin"]
|
"aliases": ["admin-gen", "admin-generator", "admin"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ generate-jwt-keys:
|
|||||||
ifndef OPENSSL_BIN
|
ifndef OPENSSL_BIN
|
||||||
$(error "Unable to generate keys (needs OpenSSL)")
|
$(error "Unable to generate keys (needs OpenSSL)")
|
||||||
endif
|
endif
|
||||||
mkdir -p etc/jwt
|
mkdir -p config/jwt
|
||||||
openssl genrsa -passout pass:${JWT_PASSPHRASE} -out ${JWT_PRIVATE_KEY_PATH} -aes256 4096
|
openssl genrsa -passout pass:${JWT_PASSPHRASE} -out ${JWT_PRIVATE_KEY_PATH} -aes256 4096
|
||||||
openssl rsa -passin pass:${JWT_PASSPHRASE} -pubout -in ${JWT_PRIVATE_KEY_PATH} -out ${JWT_PUBLIC_KEY_PATH}
|
openssl rsa -passin pass:${JWT_PASSPHRASE} -pubout -in ${JWT_PRIVATE_KEY_PATH} -out ${JWT_PUBLIC_KEY_PATH}
|
||||||
@echo "\033[32mRSA key pair successfully generated\033[39m"
|
@echo "\033[32mRSA key pair successfully generated\033[39m"
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
"Lexik\\Bundle\\JWTAuthenticationBundle\\LexikJWTAuthenticationBundle": ["all"]
|
"Lexik\\Bundle\\JWTAuthenticationBundle\\LexikJWTAuthenticationBundle": ["all"]
|
||||||
},
|
},
|
||||||
"copy-from-recipe": {
|
"copy-from-recipe": {
|
||||||
"etc/": "%ETC_DIR%"
|
"config/": "%CONFIG_DIR%"
|
||||||
},
|
},
|
||||||
"aliases": ["jwt-auth"],
|
"aliases": ["jwt-auth"],
|
||||||
"env": {
|
"env": {
|
||||||
"#1": "Key paths should be relative to the project directory",
|
"#1": "Key paths should be relative to the project directory",
|
||||||
"JWT_PRIVATE_KEY_PATH": "%ETC_DIR%/jwt/private.pem",
|
"JWT_PRIVATE_KEY_PATH": "%CONFIG_DIR%/jwt/private.pem",
|
||||||
"JWT_PUBLIC_KEY_PATH": "%ETC_DIR%/jwt/public.pem",
|
"JWT_PUBLIC_KEY_PATH": "%CONFIG_DIR%/jwt/public.pem",
|
||||||
"JWT_PASSPHRASE": "%generate(secret)%"
|
"JWT_PASSPHRASE": "%generate(secret)%"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
"Sensio\\Bundle\\FrameworkExtraBundle\\SensioFrameworkExtraBundle": ["all"]
|
"Sensio\\Bundle\\FrameworkExtraBundle\\SensioFrameworkExtraBundle": ["all"]
|
||||||
},
|
},
|
||||||
"copy-from-recipe": {
|
"copy-from-recipe": {
|
||||||
"etc/": "%ETC_DIR%/"
|
"config/": "%CONFIG_DIR%/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"copy-from-recipe": {
|
"copy-from-recipe": {
|
||||||
"etc/": "%ETC_DIR%/"
|
"config/": "%CONFIG_DIR%/"
|
||||||
},
|
},
|
||||||
"composer-scripts": {
|
"composer-scripts": {
|
||||||
"security-checker security:check": "script"
|
"security-checker security:check": "script"
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ serve_as_php:
|
|||||||
@printf "\033[32;49mServer listening on http://127.0.0.1:8000\033[39m\n";
|
@printf "\033[32;49mServer listening on http://127.0.0.1:8000\033[39m\n";
|
||||||
@printf "Quit the server with CTRL-C.\n"
|
@printf "Quit the server with CTRL-C.\n"
|
||||||
@printf "Run \033[32mcomposer require symfony/web-server-bundle\033[39m for a better web server\n"
|
@printf "Run \033[32mcomposer require symfony/web-server-bundle\033[39m for a better web server\n"
|
||||||
php -S 127.0.0.1:8000 -t web
|
php -S 127.0.0.1:8000 -t public
|
||||||
|
|
||||||
serve:
|
serve:
|
||||||
@${MAKE} serve_as_sf
|
@${MAKE} serve_as_sf
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": ["all"]
|
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": ["all"]
|
||||||
},
|
},
|
||||||
"copy-from-recipe": {
|
"copy-from-recipe": {
|
||||||
"etc/": "%ETC_DIR%/",
|
"config/": "%CONFIG_DIR%/",
|
||||||
"src/": "%SRC_DIR%/",
|
"public/": "%PUBLIC_DIR%/",
|
||||||
"web/": "%WEB_DIR%/"
|
"src/": "%SRC_DIR%/"
|
||||||
},
|
},
|
||||||
"composer-scripts": {
|
"composer-scripts": {
|
||||||
"make cache-warmup": "script",
|
"make cache-warmup": "script",
|
||||||
"assets:install --symlink --relative %WEB_DIR%": "symfony-cmd"
|
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
|
||||||
},
|
},
|
||||||
"env": {
|
"env": {
|
||||||
"APP_ENV": "dev",
|
"APP_ENV": "dev",
|
||||||
@@ -18,8 +18,8 @@
|
|||||||
},
|
},
|
||||||
"gitignore": [
|
"gitignore": [
|
||||||
".env",
|
".env",
|
||||||
|
"/public/bundles/",
|
||||||
"/var/",
|
"/var/",
|
||||||
"/vendor/",
|
"/vendor/"
|
||||||
"/web/bundles/"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ final class Kernel extends BaseKernel
|
|||||||
|
|
||||||
public function registerBundles(): iterable
|
public function registerBundles(): iterable
|
||||||
{
|
{
|
||||||
$contents = require dirname(__DIR__).'/etc/bundles.php';
|
$contents = require dirname(__DIR__).'/config/bundles.php';
|
||||||
foreach ($contents as $class => $envs) {
|
foreach ($contents as $class => $envs) {
|
||||||
if (isset($envs['all']) || isset($envs[$this->environment])) {
|
if (isset($envs['all']) || isset($envs[$this->environment])) {
|
||||||
yield new $class();
|
yield new $class();
|
||||||
@@ -39,7 +39,7 @@ final class Kernel extends BaseKernel
|
|||||||
|
|
||||||
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
|
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
|
||||||
{
|
{
|
||||||
$confDir = dirname(__DIR__).'/etc';
|
$confDir = dirname(__DIR__).'/config';
|
||||||
$loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');
|
$loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');
|
||||||
if (is_dir($confDir.'/packages/'.$this->environment)) {
|
if (is_dir($confDir.'/packages/'.$this->environment)) {
|
||||||
$loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');
|
$loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');
|
||||||
@@ -49,7 +49,7 @@ final class Kernel extends BaseKernel
|
|||||||
|
|
||||||
protected function configureRoutes(RouteCollectionBuilder $routes): void
|
protected function configureRoutes(RouteCollectionBuilder $routes): void
|
||||||
{
|
{
|
||||||
$confDir = dirname(__DIR__).'/etc';
|
$confDir = dirname(__DIR__).'/config';
|
||||||
if (is_dir($confDir.'/routing/')) {
|
if (is_dir($confDir.'/routing/')) {
|
||||||
$routes->import($confDir.'/routing/*'.self::CONFIG_EXTS, '/', 'glob');
|
$routes->import($confDir.'/routing/*'.self::CONFIG_EXTS, '/', 'glob');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"Symfony\\Bundle\\MonologBundle\\MonologBundle": ["all"]
|
"Symfony\\Bundle\\MonologBundle\\MonologBundle": ["all"]
|
||||||
},
|
},
|
||||||
"copy-from-recipe": {
|
"copy-from-recipe": {
|
||||||
"etc/": "%ETC_DIR%/"
|
"config/": "%CONFIG_DIR%/"
|
||||||
},
|
},
|
||||||
"aliases": ["log", "logger", "logging", "logs", "monolog"]
|
"aliases": ["log", "logger", "logging", "logs", "monolog"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"copy-from-package": {
|
"copy-from-package": {
|
||||||
"bin/check.php": "%BIN_DIR%/check.php",
|
"bin/check.php": "%BIN_DIR%/check.php",
|
||||||
"web/check.php": "%WEB_DIR%/check.php"
|
"public/check.php": "%PUBLIC_DIR%/check.php"
|
||||||
},
|
},
|
||||||
"composer-scripts": {
|
"composer-scripts": {
|
||||||
"%BIN_DIR%/check.php": "php-script"
|
"%BIN_DIR%/check.php": "php-script"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"copy-from-recipe": {
|
"copy-from-recipe": {
|
||||||
"etc/": "%ETC_DIR%/"
|
"config/": "%CONFIG_DIR%/"
|
||||||
},
|
},
|
||||||
"aliases": ["router"]
|
"aliases": ["router"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"Symfony\\Bundle\\SecurityBundle\\SecurityBundle": ["all"]
|
"Symfony\\Bundle\\SecurityBundle\\SecurityBundle": ["all"]
|
||||||
},
|
},
|
||||||
"copy-from-recipe": {
|
"copy-from-recipe": {
|
||||||
"etc/": "%ETC_DIR%/"
|
"config/": "%CONFIG_DIR%/"
|
||||||
},
|
},
|
||||||
"aliases": ["security"]
|
"aliases": ["security"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"Symfony\\Bundle\\SwiftmailerBundle\\SwiftmailerBundle": ["all"]
|
"Symfony\\Bundle\\SwiftmailerBundle\\SwiftmailerBundle": ["all"]
|
||||||
},
|
},
|
||||||
"copy-from-recipe": {
|
"copy-from-recipe": {
|
||||||
"etc/": "%ETC_DIR%/"
|
"config/": "%CONFIG_DIR%/"
|
||||||
},
|
},
|
||||||
"env": {
|
"env": {
|
||||||
"#1": "For Gmail as a transport, use: \"gmail://username:password@localhost\"",
|
"#1": "For Gmail as a transport, use: \"gmail://username:password@localhost\"",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"copy-from-recipe": {
|
"copy-from-recipe": {
|
||||||
"etc/": "%ETC_DIR%/",
|
"config/": "%CONFIG_DIR%/",
|
||||||
"translations/": "translations/"
|
"translations/": "translations/"
|
||||||
},
|
},
|
||||||
"container": {
|
"container": {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"Symfony\\Bundle\\TwigBundle\\TwigBundle": ["all"]
|
"Symfony\\Bundle\\TwigBundle\\TwigBundle": ["all"]
|
||||||
},
|
},
|
||||||
"copy-from-recipe": {
|
"copy-from-recipe": {
|
||||||
"etc/": "%ETC_DIR%/",
|
"config/": "%CONFIG_DIR%/",
|
||||||
"templates/": "templates/"
|
"templates/": "templates/"
|
||||||
},
|
},
|
||||||
"aliases": ["twig", "template", "templates", "templating"]
|
"aliases": ["twig", "template", "templates", "templating"]
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
"Symfony\\Bundle\\WebProfilerBundle\\WebProfilerBundle": ["dev", "test"]
|
"Symfony\\Bundle\\WebProfilerBundle\\WebProfilerBundle": ["dev", "test"]
|
||||||
},
|
},
|
||||||
"copy-from-recipe": {
|
"copy-from-recipe": {
|
||||||
"etc/": "%ETC_DIR%/"
|
"config/": "%CONFIG_DIR%/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user