GithubHelp home page GithubHelp logo

binarious / core-bundle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from contao/core-bundle

0.0 1.0 0.0 47.13 MB

[READ-ONLY] Contao Core Bundle

License: GNU Lesser General Public License v3.0

PHP 96.09% CSS 1.44% JavaScript 2.17% HTML 0.31%

core-bundle's Introduction

Contao 4 core bundle

Contao is an Open Source PHP Content Management System for people who want a professional website that is easy to maintain. Visit the project website for more information.

Contao 4 has been designed as a Symfony bundle, which can be used to add CMS functionality to any Symfony application. If you do not have an existing Symfony application yet, we recommend using the Contao managed edition as basis for your application.

Prerequisites

The Contao core bundle has a recipe in the symfony/recipes-contrib repository. Be sure to either enable contrib recipes for your project by running the following command or follow the instructions to use the contrib recipe during the installation process.

composer config extra.symfony.allow-contrib true

Add the contao-component-dir to the extra section of your composer.json file.

composer config extra.contao-component-dir assets

Installation

Install Contao and all its dependencies by executing the following command:

composer require \
    contao/core-bundle:4.8.* \
    contao/installation-bundle:^4.8 \
    php-http/guzzle6-adapter:^1.1

Note that you can exchange the php-http/guzzle6-adapter package with any other HTTP client implementation. If you already have an HTTP client implementation, you can omit the package entirely.

Configuration

Configure the DATABASE_URL in your environment, either using environment variables or by using the Dotenv component.

Enable ESI in the config/packages/framework.yaml file.

framework:
    esi: true

Add the Contao routes to your config/routing.yaml file, and be sure to load the ContaoCoreBundle at the very end, so the catch all route does not catch your application routes.

ContaoCoreBundle:
    resource: "@ContaoCoreBundle/Resources/config/routing.yml"

Edit your config/security.yml file and merge all the providers, encoders, firewalls and access_control sections:

security:
    providers:
        contao.security.backend_user_provider:
            id: contao.security.backend_user_provider

        contao.security.frontend_user_provider:
            id: contao.security.frontend_user_provider

    encoders:
        Contao\User:
            algorithm: auto

    firewalls:
        dev:
            pattern: ^/(_(profiler|wdt|error)|css|images|js)/
            security: false

        contao_install:
            pattern: ^/contao/install$
            security: false

        contao_backend:
            entry_point: contao.security.entry_point
            request_matcher: contao.routing.backend_matcher
            provider: contao.security.backend_user_provider
            user_checker: contao.security.user_checker
            anonymous: ~
            switch_user: true

            contao_login:
                login_path: contao_backend_login
                check_path: contao_backend_login
                default_target_path: contao_backend
                success_handler: contao.security.authentication_success_handler
                failure_handler: contao.security.authentication_failure_handler
                remember_me: false

            two_factor:
                auth_form_path: contao_backend_login
                check_path: contao_backend_two_factor
                default_target_path: contao_backend
                success_handler: contao.security.authentication_success_handler
                auth_code_parameter_name: verify

            logout:
                path: contao_backend_logout
                handlers:
                    - contao.security.logout_handler
                    - contao_manager.security.logout_handler
                success_handler: contao.security.logout_success_handler

        contao_frontend:
            request_matcher: contao.routing.frontend_matcher
            provider: contao.security.frontend_user_provider
            user_checker: contao.security.user_checker
            anonymous: ~
            switch_user: false

            contao_login:
                login_path: contao_frontend_login
                check_path: contao_frontend_login
                default_target_path: contao_root
                failure_path: contao_root
                success_handler: contao.security.authentication_success_handler
                failure_handler: contao.security.authentication_failure_handler
                remember_me: true
                use_forward: true

            two_factor:
                auth_form_path: contao_frontend_two_factor
                check_path: contao_frontend_two_factor
                default_target_path: contao_root
                success_handler: contao.security.authentication_success_handler
                auth_code_parameter_name: verify
                prepare_on_login: true
                prepare_on_access_denied: true

            remember_me:
                secret: '%kernel.secret%'
                remember_me_parameter: autologin

            logout:
                path: contao_frontend_logout
                target: contao_root
                handlers:
                    - contao.security.logout_handler
                success_handler: contao.security.logout_success_handler

    access_control:
        - { path: ^/contao/login$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/contao/logout$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/contao(/|$), roles: ROLE_USER }
        - { path: ^/_contao/two-factor$, roles: [IS_AUTHENTICATED_2FA_IN_PROGRESS, ROLE_MEMBER] }
        - { path: ^/, roles: [IS_AUTHENTICATED_2FA_IN_PROGRESS, IS_AUTHENTICATED_ANONYMOUSLY] }

The Contao core-bundle as well as the installation-bundle are now installed and activated. Use the Contao install tool to complete the installation by opening the /contao/install route in your browser.

License

Contao is licensed under the terms of the LGPLv3.

Getting support

Visit the support page to learn about the available support options.

core-bundle's People

Contributors

aschempp avatar ausi avatar backbone87 avatar bekanntmacher avatar bugbuster1701 avatar bytehead avatar davidenke avatar discordier avatar dmolineus avatar fritzmg avatar gmpf avatar henobi avatar jamesdevine avatar kroka avatar leofeyer avatar m-vo avatar marcobiedermann avatar mroi avatar mynyx avatar psi-4ward avatar qzminski avatar rolandschuetz avatar serhii-dv avatar stefanheimes avatar taca avatar tobaco avatar toflar avatar tristanlins avatar volkerrichert avatar xchs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.