├── CHANGELOG.md ├── var ├── logs │ └── .gitignore └── cache │ └── .gitignore ├── web ├── favicon.ico ├── app.php ├── app_dev.php └── .htaccess ├── app ├── config │ ├── routing.yml │ ├── routing_dev.yml │ ├── config_test.yml │ ├── config_prod.yml │ ├── parameters.yml.dist │ ├── security.yml │ ├── config_dev.yml │ └── config.yml ├── AppCache.php └── AppKernel.php ├── .gitignore ├── bin └── console ├── README.md └── composer.json /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Contao standard edition change log 2 | -------------------------------------------------------------------------------- /var/logs/.gitignore: -------------------------------------------------------------------------------- 1 | # Dummy file to make Git create the folder 2 | * 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /var/cache/.gitignore: -------------------------------------------------------------------------------- 1 | # Dummy file to make Git create the folder 2 | * 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contao/standard-edition/HEAD/web/favicon.ico -------------------------------------------------------------------------------- /app/config/routing.yml: -------------------------------------------------------------------------------- 1 | contao_installation: 2 | resource: "@ContaoInstallationBundle/Resources/config/routing.yml" 3 | 4 | contao: 5 | resource: "@ContaoCoreBundle/Resources/config/routing.yml" 6 | -------------------------------------------------------------------------------- /app/config/routing_dev.yml: -------------------------------------------------------------------------------- 1 | _wdt: 2 | resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml" 3 | prefix: /_wdt 4 | 5 | _profiler: 6 | resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml" 7 | prefix: /_profiler 8 | 9 | _main: 10 | resource: routing.yml 11 | -------------------------------------------------------------------------------- /app/config/config_test.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: config.yml } 3 | 4 | # Framework configuration 5 | framework: 6 | test: ~ 7 | session: 8 | storage_id: session.storage.mock_file 9 | profiler: 10 | enabled: false 11 | 12 | # Web profiler configuration 13 | web_profiler: 14 | toolbar: false 15 | intercept_redirects: false 16 | 17 | # SwiftMailer configuration 18 | swiftmailer: 19 | disable_delivery: true 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # App config 2 | /app/config/parameters.yml 3 | 4 | # Generated folders 5 | /assets/ 6 | /files/ 7 | /system/* 8 | !/system/config/ 9 | /system/config/localconfig.php 10 | /system/config/tcpdf.php 11 | /templates/ 12 | /vendor/ 13 | 14 | # Symlinked resources 15 | /web/assets 16 | /web/bundles/ 17 | /web/files/ 18 | /web/share/ 19 | /web/system/ 20 | /web/vendor/ 21 | 22 | # Skip files 23 | /system/modules/*/.skip 24 | 25 | # Composer package manager 26 | /composer/ 27 | -------------------------------------------------------------------------------- /app/config/config_prod.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: config.yml } 3 | 4 | # Monolog configuration 5 | monolog: 6 | handlers: 7 | contao: 8 | type: service 9 | id: contao.monolog.handler 10 | main: 11 | type: fingers_crossed 12 | action_level: error 13 | handler: nested 14 | nested: 15 | type: rotating_file 16 | max_files: 10 17 | path: "%kernel.logs_dir%/%kernel.environment%.log" 18 | level: info 19 | console: 20 | type: console 21 | -------------------------------------------------------------------------------- /web/app.php: -------------------------------------------------------------------------------- 1 | handle($request); 25 | $response->send(); 26 | $kernel->terminate($request, $response); 27 | -------------------------------------------------------------------------------- /app/config/parameters.yml.dist: -------------------------------------------------------------------------------- 1 | # This file is a "template" of what your parameters.yml file should look like 2 | # Set parameters here that may be different on each deployment target of the app, e.g. development, staging, production. 3 | # http://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration 4 | parameters: 5 | database_host: localhost 6 | database_port: 3306 7 | database_user: ~ 8 | database_password: ~ 9 | database_name: ~ 10 | 11 | mailer_transport: mail 12 | mailer_host: 127.0.0.1 13 | mailer_user: ~ 14 | mailer_password: ~ 15 | mailer_port: 25 16 | mailer_encryption: ~ 17 | 18 | prepend_locale: false 19 | 20 | secret: ThisTokenIsNotSoSecretChangeIt 21 | -------------------------------------------------------------------------------- /app/config/security.yml: -------------------------------------------------------------------------------- 1 | security: 2 | providers: 3 | contao.security.user_provider: 4 | id: contao.security.user_provider 5 | 6 | firewalls: 7 | dev: 8 | pattern: ^/(_(profiler|wdt|error)|css|images|js)/ 9 | security: false 10 | 11 | install: 12 | pattern: ^/(contao/install|install\.php) 13 | security: false 14 | 15 | backend: 16 | request_matcher: contao.routing.backend_matcher 17 | stateless: true 18 | simple_preauth: 19 | authenticator: contao.security.authenticator 20 | 21 | frontend: 22 | request_matcher: contao.routing.frontend_matcher 23 | stateless: true 24 | simple_preauth: 25 | authenticator: contao.security.authenticator 26 | -------------------------------------------------------------------------------- /bin/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev'); 23 | $debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod'; 24 | 25 | if ($debug) { 26 | Debug::enable(); 27 | } 28 | 29 | $kernel = new AppKernel($env, $debug); 30 | $application = new Application($kernel); 31 | $application->run($input); 32 | -------------------------------------------------------------------------------- /app/config/config_dev.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: config.yml } 3 | 4 | # Framework configuration 5 | framework: 6 | router: 7 | resource: "%kernel.root_dir%/config/routing_dev.yml" 8 | strict_requirements: true 9 | profiler: { only_exceptions: false } 10 | 11 | # Web profiler configuration 12 | web_profiler: 13 | toolbar: true 14 | intercept_redirects: false 15 | 16 | # Monolog configuration 17 | monolog: 18 | handlers: 19 | contao: 20 | type: service 21 | id: contao.monolog.handler 22 | main: 23 | type: rotating_file 24 | max_files: 10 25 | path: "%kernel.logs_dir%/%kernel.environment%.log" 26 | level: debug 27 | channels: ['!doctrine', '!event', '!php'] 28 | console: 29 | type: console 30 | bubble: false 31 | verbosity_levels: 32 | VERBOSITY_VERBOSE: INFO 33 | VERBOSITY_VERY_VERBOSE: DEBUG 34 | channels: ['!doctrine'] 35 | console_very_verbose: 36 | type: console 37 | bubble: false 38 | verbosity_levels: 39 | VERBOSITY_VERBOSE: NOTICE 40 | VERBOSITY_VERY_VERBOSE: NOTICE 41 | VERBOSITY_DEBUG: DEBUG 42 | channels: ['doctrine'] 43 | -------------------------------------------------------------------------------- /app/AppCache.php: -------------------------------------------------------------------------------- 1 | addSubscriber(new HeaderReplaySubscriber()); 33 | } 34 | 35 | /** 36 | * {@inheritdoc} 37 | */ 38 | public function fetch(Request $request, $catch = false) 39 | { 40 | return parent::fetch($request, $catch); 41 | } 42 | 43 | /** 44 | * {@inheritdoc} 45 | */ 46 | protected function getOptions() 47 | { 48 | return ['allow_reload' => true]; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /web/app_dev.php: -------------------------------------------------------------------------------- 1 | handle($request); 53 | $response->send(); 54 | $kernel->terminate($request, $response); 55 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Contao standard edition 2 | ======================= 3 | 4 | Welcome to the Contao standard edition, a fully-functional Contao 4 application 5 | that you can use as the skeleton for your new applications. 6 | 7 | 8 | What's inside? 9 | -------------- 10 | 11 | The Contao standard edition is configured with the following defaults: 12 | 13 | * Twig as template engine; 14 | * Doctrine ORM/DBAL; 15 | * Swiftmailer; 16 | * Annotations enabled for everything. 17 | 18 | It comes pre-configured with the following Symfony bundles: 19 | 20 | * **FrameworkBundle** - The core Symfony framework bundle 21 | * **SecurityBundle** - Adds security by integrating Symfony's security component 22 | * **TwigBundle** - Adds support for the Twig templating engine 23 | * **MonologBundle** - Adds support for Monolog, a logging library 24 | * **SwiftmailerBundle** - Adds support for Swiftmailer, a library for sending emails 25 | * **DoctrineBundle** - Adds support for the Doctrine ORM 26 | * **KnpMenuBundle** - Provides an integration of the KnpMenu library 27 | * **KnpTimeBundle** - Makes your dates look sensible and descriptive 28 | * **LexikMaintenanceBundle** - Allows you to put your website in maintenance mode 29 | * **NelmioCorsBundle** - Adds Cross-Origin Resource Sharing headers support 30 | * **NelmioSecurityBundle** - Adds extra security-related features 31 | * **SensioFrameworkExtraBundle** - Adds several enhancements, including template and routing annotation capability 32 | * **DebugBundle** (in dev/test env) - Adds Debug and VarDumper component integration 33 | * **WebProfilerBundle** (in dev/test env) - Adds profiling functionality and the web debug toolbar 34 | * **SensioDistributionBundle** (in dev/test env) - Adds functionality for configuring and working with Symfony distributions 35 | 36 | It also comes pre-configured with the following Contao bundles: 37 | 38 | * **ContaoCoreBundle** - The Contao core bundle 39 | * **ContaoCalendarBundle** - Adds calendar functionality to Contao 40 | * **ContaoCommentsBundle** - Adds comments functionality to Contao 41 | * **ContaoFaqBundle** - Adds FAQ functionality to Contao 42 | * **ContaoInstallationBundle** - Required to install and update Contao 43 | * **ContaoListingBundle** - Allows to list arbitrary data in the front end 44 | * **ContaoNewsBundle** - Adds news functionality to Contao 45 | * **ContaoNewsletterBundle** - Adds newsletter functionality to Contao 46 | 47 | Enjoy! 48 | -------------------------------------------------------------------------------- /app/config/config.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: security.yml } 3 | 4 | # Put parameters here that don't need to change on each machine where the app is deployed 5 | # http://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration 6 | parameters: 7 | locale: en 8 | 9 | # Framework configuration 10 | framework: 11 | esi: { enabled: true } 12 | translator: { fallbacks: ["%locale%"] } 13 | secret: "%secret%" 14 | router: 15 | resource: "%kernel.root_dir%/config/routing.yml" 16 | strict_requirements: ~ 17 | csrf_protection: ~ 18 | templating: 19 | engines: ['twig'] 20 | default_locale: "%locale%" 21 | session: 22 | handler_id: ~ 23 | fragments: { path: /_fragment } 24 | 25 | # Contao configuration 26 | contao: 27 | prepend_locale: "%prepend_locale%" 28 | 29 | # Twig configuration 30 | twig: 31 | debug: "%kernel.debug%" 32 | strict_variables: "%kernel.debug%" 33 | 34 | # Doctrine configuration 35 | doctrine: 36 | dbal: 37 | default_connection: default 38 | connections: 39 | default: 40 | driver: pdo_mysql 41 | host: "%database_host%" 42 | port: "%database_port%" 43 | user: "%database_user%" 44 | password: "%database_password%" 45 | dbname: "%database_name%" 46 | charset: UTF8 47 | types: 48 | binary_string: 49 | class: "Contao\\CoreBundle\\Doctrine\\DBAL\\Types\\BinaryStringType" 50 | commented: true 51 | 52 | # SwiftMailer configuration 53 | swiftmailer: 54 | transport: "%mailer_transport%" 55 | host: "%mailer_host%" 56 | username: "%mailer_user%" 57 | password: "%mailer_password%" 58 | port: "%mailer_port%" 59 | encryption: "%mailer_encryption%" 60 | 61 | # Lexik configuration 62 | lexik_maintenance: 63 | authorized: 64 | path: ^/contao($|/) 65 | attributes: 66 | _bypass_maintenance: true 67 | driver: 68 | class: "Lexik\\Bundle\\MaintenanceBundle\\Drivers\\FileDriver" 69 | options: { file_path: "%kernel.cache_dir%/../maintenance_lock" } 70 | 71 | # Security configuration 72 | nelmio_security: 73 | clickjacking: 74 | paths: 75 | '^/.*': SAMEORIGIN 76 | content_type: 77 | nosniff: true 78 | referrer_policy: 79 | enabled: true 80 | policies: 81 | - 'no-referrer-when-downgrade' 82 | - 'strict-origin-when-cross-origin' 83 | xss_protection: 84 | enabled: true 85 | mode_block: true 86 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "contao/standard-edition", 3 | "type": "project", 4 | "description": "Contao Open Source CMS", 5 | "license": "LGPL-3.0+", 6 | "authors": [ 7 | { 8 | "name": "Leo Feyer", 9 | "homepage": "https://github.com/leofeyer" 10 | } 11 | ], 12 | "require": { 13 | "php": "^7.1", 14 | "symfony/symfony": "3.3.*", 15 | "symfony/monolog-bundle": "^3.1", 16 | "symfony/swiftmailer-bundle": "^2.3.10", 17 | "sensio/distribution-bundle": "^5.0.19", 18 | "sensio/framework-extra-bundle": "^3.0.2", 19 | "doctrine/doctrine-bundle": "^1.6", 20 | "lexik/maintenance-bundle": "^2.0", 21 | "nelmio/security-bundle": "^2.2", 22 | "php-http/guzzle6-adapter": "^1.1", 23 | "contao/calendar-bundle": "^4.4", 24 | "contao/comments-bundle": "^4.4", 25 | "contao/core-bundle": "^4.4", 26 | "contao/faq-bundle": "^4.4", 27 | "contao/installation-bundle": "^4.4", 28 | "contao/listing-bundle": "^4.4", 29 | "contao/news-bundle": "^4.4", 30 | "contao/newsletter-bundle": "^4.4", 31 | "incenteev/composer-parameter-handler": "^2.0" 32 | }, 33 | "conflict": { 34 | "contao/core-bundle": "<4.4.1", 35 | "swiftmailer/swiftmailer": "<5.4.5", 36 | "symfony/swiftmailer-bundle": "2.6.* <2.6.2" 37 | }, 38 | "autoload": { 39 | "classmap": [ 40 | "app/AppCache.php", 41 | "app/AppKernel.php" 42 | ] 43 | }, 44 | "config": { 45 | "component-dir": "assets", 46 | "preferred-install": "dist" 47 | }, 48 | "extra": { 49 | "incenteev-parameters": { 50 | "file": "app/config/parameters.yml", 51 | "env-map": { 52 | "secret": "CONTAO_RANDOM_SECRET" 53 | } 54 | }, 55 | "symfony-app-dir": "app", 56 | "symfony-bin-dir": "bin", 57 | "symfony-var-dir": "var", 58 | "symfony-web-dir": "web", 59 | "symfony-assets-install": "relative" 60 | }, 61 | "scripts": { 62 | "setup-scripts": [ 63 | "Contao\\CoreBundle\\Composer\\ScriptHandler::generateRandomSecret", 64 | "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", 65 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 66 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 67 | "Contao\\CoreBundle\\Composer\\ScriptHandler::addDirectories", 68 | "Contao\\CoreBundle\\Composer\\ScriptHandler::generateSymlinks" 69 | ], 70 | "post-install-cmd": [ "@setup-scripts" ], 71 | "post-update-cmd": [ "@setup-scripts" ] 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /web/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | # Allow access from all domains for webfonts (see contao/core-bundle#528) 3 | 4 | Header set Access-Control-Allow-Origin "*" 5 | 6 | 7 | 8 | 9 | RewriteEngine On 10 | 11 | # Determine the RewriteBase automatically and set it as environment variable. 12 | # If you are using Apache aliases to do mass virtual hosting or installed the 13 | # project in a subdirectory, the base path will be prepended to allow proper 14 | # resolution of the app.php file and to redirect to the correct URI. It will 15 | # work in environments without path prefix as well, providing a safe, one-size 16 | # fits all solution. But as you do not need it in this case, you can comment 17 | # the following 2 lines to eliminate the overhead. 18 | RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ 19 | RewriteRule ^(.*) - [E=BASE:%1] 20 | 21 | # Sets the HTTP_AUTHORIZATION header removed by Apache 22 | RewriteCond %{HTTP:Authorization} . 23 | RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 24 | 25 | # Redirect to URI without front controller to prevent duplicate content 26 | # (with and without `/app.php`). Only do this redirect on the initial 27 | # rewrite by Apache and not on subsequent cycles. Otherwise we would get an 28 | # endless redirect loop (request -> rewrite to front controller -> 29 | # redirect -> request -> ...). 30 | # So in case you get a "too many redirects" error or you always get redirected 31 | # to the start page because your Apache does not expose the REDIRECT_STATUS 32 | # environment variable, you have 2 choices: 33 | # - disable this feature by commenting the following 2 lines or 34 | # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the 35 | # following RewriteCond (best solution) 36 | RewriteCond %{ENV:REDIRECT_STATUS} ^$ 37 | RewriteRule ^app\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L] 38 | 39 | # If the requested filename exists, simply serve it. 40 | # We only want to let Apache serve files and not directories. 41 | RewriteCond %{REQUEST_FILENAME} -f 42 | RewriteRule ^ - [L] 43 | 44 | # Rewrite all other queries to the front controller. 45 | RewriteRule ^ %{ENV:BASE}/app.php [L] 46 | 47 | 48 | 49 | 50 | # When mod_rewrite is not available, we instruct a temporary redirect of 51 | # the start page to the front controller explicitly so that the website 52 | # and the generated links can still be used. 53 | RedirectMatch 302 ^/$ /app.php/ 54 | # RedirectTemp cannot be used instead 55 | 56 | 57 | -------------------------------------------------------------------------------- /app/AppKernel.php: -------------------------------------------------------------------------------- 1 | getEnvironment(), ['dev', 'test'])) { 47 | $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); 48 | $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); 49 | $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); 50 | } 51 | 52 | return $bundles; 53 | } 54 | 55 | /** 56 | * {@inheritdoc} 57 | */ 58 | public function getRootDir() 59 | { 60 | return __DIR__; 61 | } 62 | 63 | /** 64 | * {@inheritdoc} 65 | */ 66 | public function getCacheDir() 67 | { 68 | return dirname(__DIR__).'/var/cache/'.$this->getEnvironment(); 69 | } 70 | 71 | /** 72 | * {@inheritdoc} 73 | */ 74 | public function getLogDir() 75 | { 76 | return dirname(__DIR__).'/var/logs'; 77 | } 78 | 79 | /** 80 | * {@inheritdoc} 81 | */ 82 | public function registerContainerConfiguration(LoaderInterface $loader) 83 | { 84 | $rootDir = $this->getRootDir(); 85 | 86 | if (file_exists($rootDir.'/config/parameters.yml')) { 87 | $loader->load($rootDir.'/config/parameters.yml'); 88 | } 89 | 90 | $loader->load($rootDir.'/config/config_'.$this->getEnvironment().'.yml'); 91 | } 92 | } 93 | --------------------------------------------------------------------------------