Project

General

Profile

Wiki

Preamble

This project serves to make symfony project more simply. It generate a base project to work with our current spec. The purpose of our symfony website is provide an API to map the database with our mobile applications.

For us, this project is a part of our stack. We use harmony (https://support.tactfactory.com/projects/harmony/wiki/), dory help for the symfony generation.

Installation (without harmony)

Composer needs

Next lines are an simple (but complete) example of composer.json, no need to ask symfony/symfony ... You need to add only your specifics bundles and librairies.

{
    "name" : "jonathan/dory.test.prefere.stable",
    "license" : "proprietary",
    "type" : "project",
    "autoload" : {
        "psr-4" : {
            "" : "src/" 
        },
        "classmap" : [
            "app/AppKernel.php",
            "app/AppCache.php" 
        ]
    },
    "require" : {
        "php" : "^7.0",
        "tactfactory/dory-bundle" : "~0.1" 
    },
    "require-dev" : {
        "sensio/generator-bundle" : "~3.0",
        "symfony/phpunit-bridge" : "~2.7",
        "liip/functional-test-bundle" : "^1.6" 
    },
    "scripts" : {
        "symfony-scripts": [
            "Tact\\DoryBundle\\Composer\\ScriptHandler::install",
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget" 
        ],
        "post-install-cmd" : [
            "@symfony-scripts" 
        ],
        "post-update-cmd" : [
            "@symfony-scripts" 
        ]
    },
    "config" : {
        "platform" : {
            "php" : "7.0.7" 
        },
        "secure-http" : false
    },
    "extra" : {
        "symfony-app-dir" : "app",
        "symfony-web-dir" : "web",
        "symfony-assets-install" : "relative",
        "incenteev-parameters" : {
            "file" : "app/config/parameters.yml" 
        }
    },
    "repositories" : [{
            "type" : "vcs",
            "url" : "http://git.tactfactory.com/tact-dory-bundle/tact-dory-bundle-web.git" 
        }
    ],
    "minimum-stability" : "stable",
    "prefer-stable" : true
}

And after ?

No specificaly process to do from you. Just call composer update, composer will install dory.

Automatic stuff processed by dory (from composer post script)

Config

imports:
    - { resource: "imports.yml" }

Routing

Dory adds the following lines (into routing.yml --- default example without local overrides) :

dory:
    resource: "@TactDoryBundle/Resources/config/routing.yml" 
    prefix: /

AppKernel

Example :

    public function registerBundles() {
        $localBundles = [
            // [..Other bundles..],
            new AppBundle\AppBundle()
        ];

        $bundles = \Tact\DoryBundle\Utils\KernelImporter::mergeLocalBundles($localBundles, $this->getEnvironment());

        return $bundles;
    }

You should add all yours bundles into $localBundles array. This is to prevent duplication of bundle declaration (and so crash).

Configuration & use

See the configure and use section.

Go to top
Add picture from clipboard (Maximum size: 200 MB)