Skip to content

beberlei/symfony-minimal-distribution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Symfony Minimal Distribution

This is the minimal Symfony distribution.

It only contains the following bundles:

  • FrameworkBundle
  • MonologBundle
  • TwigBundle
  • WebDebugBundle in dev-environment

It only contains one configuration file at app/config/config.yml that is parameterized by a environment variables from the phpdotenv file .env that you need to create in the project root.

This file contains environment variables:

SYMFONY_ENV=dev
SYMFONY_DEBUG=1
SYMFONY__SECRET=abcdefg
SYMFONY__MONOLOG_ACTION_LEVEL=debug

Blog post explaining the reasoning for this approach:

PHP built-in web server using app/console server:[run|start]

You need to modify the web/index.php file by adding Dotenv::makeMutable(); before the call to Dotenv::load():

<?php

require_once __DIR__ . "/../vendor/autoload.php";
require_once __DIR__ . "/../app/AppKernel.php";

use Symfony\Component\HttpFoundation\Request;

Dotenv::load(__DIR__ . '/../');
Dotenv::makeMutable();

$request = Request::createFromGlobals();
$kernel = new AppKernel($_SERVER['SYMFONY_ENV'], (bool)$_SERVER['SYMFONY_DEBUG']);
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);

About

This contains the code from my blog post http://whitewashing.de/2014/10/26/symfony_all_the_things_web.html

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •