mirror of
https://github.com/symfony/recipes.git
synced 2026-09-12 23:56:25 +03:00
added initial set of recipes
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
doctrine:
|
||||
dbal:
|
||||
driver: pdo_mysql
|
||||
host: "%env(DB_HOST)%"
|
||||
port: "%env(DB_PORT)%"
|
||||
dbname: "%env(DB_NAME)%"
|
||||
user: "%env(DB_USER)%"
|
||||
password: "%env(DB_PASSWORD)%"
|
||||
charset: UTF8
|
||||
# if using pdo_sqlite as your database driver, uncomment next line:
|
||||
# path: "%kernel.root_dir%/../var/data.db"
|
||||
orm:
|
||||
auto_generate_proxy_classes: "%kernel.debug%"
|
||||
naming_strategy: doctrine.orm.naming_strategy.underscore
|
||||
auto_mapping: true
|
||||
mappings:
|
||||
App:
|
||||
is_bundle: false
|
||||
type: annotation
|
||||
dir: "%kernel.root_dir%/../src/Entity"
|
||||
prefix: "Entity\\"
|
||||
alias: App
|
||||
@@ -0,0 +1,5 @@
|
||||
doctrine:
|
||||
orm:
|
||||
#metadata_cache_driver: apc
|
||||
#result_cache_driver: apc
|
||||
#query_cache_driver: apc
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"bundles": {
|
||||
"Doctrine\\Bundle\\DoctrineBundle\\DoctrineBundle": ["all"]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
},
|
||||
"env": {
|
||||
"DB_HOST": "127.0.0.1",
|
||||
"DB_PORT": "",
|
||||
"DB_NAME": "symfony",
|
||||
"DB_USER": "root",
|
||||
"DB_PASSWORD": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
dunglas_action:
|
||||
directories:
|
||||
- "../src/{Action,Command,Controller,EventSubscriber,Twig}"
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"bundles": {
|
||||
"Dunglas\\ActionBundle\\DunglasActionBundle": ["all"]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
services:
|
||||
easycorp.easylog.handler:
|
||||
class: EasyCorp\EasyLog\EasyLogHandler
|
||||
public: false
|
||||
arguments: ["%kernel.logs_dir%/%kernel.environment%.log"]
|
||||
|
||||
#// FIXME: How to add this configuration automatically without messing up with the monolog configuration?
|
||||
#monolog:
|
||||
# handlers:
|
||||
# buffered:
|
||||
# type: buffer
|
||||
# handler: easylog
|
||||
# channels: ["!event"]
|
||||
# level: debug
|
||||
# easylog:
|
||||
# type: service
|
||||
# id: easycorp.easylog.handler
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
easy_admin:
|
||||
entities:
|
||||
# List the entity class name you want to manage
|
||||
#Entity\Product
|
||||
#Entity\Category
|
||||
#Entity\User
|
||||
@@ -0,0 +1,4 @@
|
||||
easy_admin_bundle:
|
||||
resource: "@EasyAdminBundle/Controller"
|
||||
prefix: /admin
|
||||
type: annotation
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"bundles": {
|
||||
"JavierEguiluz\\Bundle\\EasyAdminBundle\\EasyAdminBundle": ["all"]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
framework:
|
||||
annotations: true
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"bundles": {
|
||||
"Sensio\\Bundle\\FrameworkExtraBundle\\SensioFrameworkExtraBundle": ["all"]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
services:
|
||||
sensio_distribution.security_checker:
|
||||
class: SensioLabs\Security\SecurityChecker
|
||||
public: false
|
||||
|
||||
sensio_distribution.security_checker.command:
|
||||
class: SensioLabs\Security\Command\SecurityCheckerCommand
|
||||
arguments: @sensio_distribution.security_checker
|
||||
tags:
|
||||
- { name: console.command }
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"vendor/bin/security-checker security:check": "php-script"
|
||||
}
|
||||
}
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
use Doctrine\Common\Annotations\AnnotationRegistry;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Component\Dotenv\Dotenv;
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
use Symfony\Component\Debug\Debug;
|
||||
|
||||
umask(0000);
|
||||
set_time_limit(0);
|
||||
|
||||
$loader = require __DIR__.'/../vendor/autoload.php';
|
||||
if (class_exists(AnnotationRegistry::class)) {
|
||||
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
|
||||
}
|
||||
|
||||
if (!class_exists('Symfony\Bundle\FrameworkBundle\Console\Application')) {
|
||||
throw new \RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
|
||||
}
|
||||
|
||||
if (!getenv('APP_ENV')) {
|
||||
(new Dotenv())->load(__DIR__.'/../.env');
|
||||
}
|
||||
|
||||
$input = new ArgvInput();
|
||||
$env = $input->getParameterOption(['--env', '-e'], getenv('APP_ENV') ?: 'dev');
|
||||
$debug = getenv('APP_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']);
|
||||
|
||||
if ($debug && class_exists(Debug::class)) {
|
||||
Debug::enable();
|
||||
}
|
||||
|
||||
$kernel = new AppKernel($env, $debug);
|
||||
$application = new Application($kernel);
|
||||
$application->run($input);
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"copy-from-recipe": {
|
||||
"bin/": "%BIN_DIR%/"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\DebugBundle\\DebugBundle": ["dev", "test"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
framework:
|
||||
router:
|
||||
strict_requirements: true
|
||||
@@ -0,0 +1,20 @@
|
||||
framework:
|
||||
secret: "%env(APP_SECRET)%"
|
||||
#default_locale: en
|
||||
#csrf_protection: null
|
||||
#http_method_override: true
|
||||
#trusted_hosts: null
|
||||
#trusted_proxies: null
|
||||
# http://symfony.com/doc/current/reference/configuration/framework.html#handler-id
|
||||
#session:
|
||||
# handler_id: session.handler.native_file
|
||||
# save_path: "%kernel.root_dir%/../var/sessions/%kernel.environment%"
|
||||
#],
|
||||
#esi: ~
|
||||
#fragments: ~
|
||||
php_errors:
|
||||
log: true
|
||||
router:
|
||||
resource: kernel:loadRoutes
|
||||
type: service
|
||||
strict_requirements: null
|
||||
@@ -0,0 +1,4 @@
|
||||
framework:
|
||||
test: null
|
||||
session:
|
||||
storage_id: session.storage.mock_file
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle": ["all"]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"cache:clear --no-warmup": "symfony-cmd",
|
||||
"cache:warmup": "symfony-cmd",
|
||||
"assets:install --symlink --relative %WEB_DIR%": "symfony-cmd"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Config\Resource\ClassExistenceResource;
|
||||
use Symfony\Component\Console\Application;
|
||||
|
||||
$handlers = [
|
||||
'main' => [
|
||||
'type' => 'stream',
|
||||
'path' => '%kernel.logs_dir%/%kernel.environment%.log',
|
||||
'level' => 'debug',
|
||||
'channels' => ['!event'],
|
||||
],
|
||||
// uncomment to get logging in your browser
|
||||
// you may have to allow bigger header sizes in your Web server configuration
|
||||
//'firephp' => [
|
||||
// 'type' => 'firephp',
|
||||
// 'level' => 'info',
|
||||
//],
|
||||
//'chromephp' => [
|
||||
// 'type' => 'chromephp',
|
||||
// 'level' => 'info',
|
||||
//],
|
||||
];
|
||||
|
||||
$container->addResource(new ClassExistenceResource(Application::class));
|
||||
if (class_exists(Application::class)) {
|
||||
$handlers['console'] = [
|
||||
'type' => 'console',
|
||||
'channels' => ['!event', '!doctrine'],
|
||||
];
|
||||
}
|
||||
|
||||
$container->loadFromExtension('monolog', [
|
||||
'handlers' => $handlers,
|
||||
]);
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Config\Resource\ClassExistenceResource;
|
||||
use Symfony\Component\Console\Application;
|
||||
|
||||
$handlers = [
|
||||
'main' => [
|
||||
'type' => 'fingers_crossed',
|
||||
'action_level' => 'error',
|
||||
'handler' => 'nested',
|
||||
],
|
||||
'nested' => [
|
||||
'type' => 'stream',
|
||||
'path' => '%kernel.logs_dir%/%kernel.environment%.log',
|
||||
'level' => 'debug',
|
||||
],
|
||||
];
|
||||
|
||||
$container->addResource(new ClassExistenceResource(Application::class));
|
||||
if (class_exists(Application::class)) {
|
||||
$handlers['console'] = [
|
||||
'type' => 'console',
|
||||
'channels' => ['!event', '!doctrine'],
|
||||
];
|
||||
}
|
||||
|
||||
$container->loadFromExtension('monolog', [
|
||||
'handlers' => $handlers,
|
||||
]);
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\MonologBundle\\MonologBundle": ["all"]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"copy-from-package": {
|
||||
"bin/check.php": "%BIN_DIR%/check.php",
|
||||
"web/check.php": "%WEB_DIR%/check.php"
|
||||
},
|
||||
"composer-scripts": {
|
||||
"%BIN_DIR%/check.php": "php-script"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
security:
|
||||
# http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers
|
||||
providers:
|
||||
in_memory: { memory: null }
|
||||
firewalls:
|
||||
dev:
|
||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||
security: false
|
||||
main:
|
||||
anonymous: null
|
||||
|
||||
# activate different ways to authenticate
|
||||
|
||||
# http_basic: null
|
||||
# http://symfony.com/doc/current/book/security.html#a-configuring-how-your-users-will-authenticate
|
||||
|
||||
# form_login: null
|
||||
# http://symfony.com/doc/current/cookbook/security/form_login_setup.html
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\SecurityBundle\\SecurityBundle": ["all"]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
#swiftmailer:
|
||||
#delivery_address: me@example.com
|
||||
@@ -0,0 +1,6 @@
|
||||
swiftmailer:
|
||||
transport: smtp
|
||||
host: "%env(MAILER_HOST)%"
|
||||
username: "%env(MAILER_USERNAME)%"
|
||||
password: "%env(MAILER_PASSWORD)%"
|
||||
spool: { type: "memory" }
|
||||
@@ -0,0 +1,2 @@
|
||||
swiftmailer:
|
||||
disable_delivery: true
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\SwiftmailerBundle\\SwiftmailerBundle": ["all"]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/"
|
||||
},
|
||||
"env": {
|
||||
"MAILER_HOST": "127.0.0.1",
|
||||
"MAILER_USERNAME": "",
|
||||
"MAILER_PASSWORD": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
twig:
|
||||
paths: ["%kernel.root_dir%/../templates"]
|
||||
debug: "%kernel.debug%"
|
||||
strict_variables: "%kernel.debug%"
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\TwigBundle\\TwigBundle": ["all"]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
web_profiler:
|
||||
toolbar: true
|
||||
intercept_redirects: false
|
||||
|
||||
framework:
|
||||
profiler: { only_exceptions: false }
|
||||
@@ -0,0 +1,6 @@
|
||||
web_profiler:
|
||||
toolbar: false
|
||||
intercept_redirects: false
|
||||
|
||||
framework:
|
||||
profiler: { collect: false }
|
||||
@@ -0,0 +1,7 @@
|
||||
web_profiler_wdt:
|
||||
resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
|
||||
prefix: /_wdt
|
||||
|
||||
web_profiler_profiler:
|
||||
resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
|
||||
prefix: /_profiler
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\WebProfilerBundle\\WebProfilerBundle": ["dev", "test"]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"etc/": "%ETC_DIR%/"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"bundles": {
|
||||
"Symfony\\Bundle\\WebServerBundle\\WebServerBundle": ["dev"]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user