Dépannage "requièrent une fois(../bootstrap.php.cache): n'a pas réussi à ouvrir stream: aucun fichier ou répertoire de ce type"

j'essaie de redéployer un Symfony 2.1 x projet sur lequel j'ai travaillé et app_dev.php est en panne car il ne trouve pas app/bootstrap.php.cache. Ce fichier est omis du dépôt git du projet parce que J'ai utilisé la recommandation de Symfony2 .gitignore fichier:

# .gitignore
/app/bootstrap*

ai-je raison de penser que app/bootstrap.php.cache est généré pendant le $ php composer.phar install processus? Si c'est le cas, alors je vais l'inclure pour vous mes composer.json:

// composer.json
{
    "name": "symfony/framework-standard-edition",
    "description": "The "Symfony Standard Edition" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.1.*",
        "doctrine/orm": "2.2.*",
        "doctrine/doctrine-bundle": "dev-master",
        "twig/extensions": "dev-master",
        "symfony/assetic-bundle": "dev-master",
        "symfony/swiftmailer-bundle": "dev-master",
        "symfony/monolog-bundle": "dev-master",
        "sensio/distribution-bundle": "dev-master",
        "sensio/framework-extra-bundle": "dev-master",
        "sensio/generator-bundle": "dev-master",
        "jms/security-extra-bundle": "1.1.*",
        "jms/di-extra-bundle": "1.0.*",
        "ddeboer/guzzle-bundle": "dev-master",
        "mopa/bootstrap-bundle": "dev-master",
        "twitter/bootstrap": "master",
        "knplabs/knp-paginator-bundle": "dev-master",
        "knplabs/knp-menu-bundle": "dev-master",
        "craue/formflow-bundle": "dev-master"
    },
    "repositories": [
        {
            "type": "package",
            "package": {
                "version": "master",
                "name": "twitter/bootstrap",
                "source": {
                    "url": "https://github.com/twitter/bootstrap.git",
                    "type": "git",
                    "reference": "master"
                },
                "dist": {
                    "url": "https://github.com/twitter/bootstrap/zipball/master",
                    "type": "zip"
                }
            }
        }
    ],
    "scripts": {
        "post-install-cmd": [
            "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap",
            "SensioBundleDistributionBundleComposerScriptHandler::clearCache",
            "SensioBundleDistributionBundleComposerScriptHandler::installAssets",
            "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "SensioBundleDistributionBundleComposerScriptHandler::buildBootstrap",
            "SensioBundleDistributionBundleComposerScriptHandler::clearCache",
            "SensioBundleDistributionBundleComposerScriptHandler::installAssets",
            "SensioBundleDistributionBundleComposerScriptHandler::installRequirementsFile"
        ],
        "post-install-cmd": [
            "MopaBundleBootstrapBundleComposerScriptHandler::postInstallSymlinkTwitterBootstrap"
        ],
        "post-update-cmd": [
            "MopaBundleBootstrapBundleComposerScriptHandler::postInstallSymlinkTwitterBootstrap"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "minimum-stability": "dev",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web"
    }
}

Comment puis-je générer <!--8?

39
demandé sur jcroll 2012-08-14 22:01:36

3 réponses

il suffit d'aller à votre projet et de le générer avec composer comme

php /path/to/composer/composer.phar install
75
répondu nvvetal 2017-01-25 10:35:38

il suffit de lancer la commande suivante.

php composer.phar install

Source:http://symfony.com/doc/master/book/performance.html#use-bootstrap-files

10
répondu Farid Movsumov 2016-02-12 14:01:51

Vous avez dupliqué post-install-cmd et post-updated-cmd alors que vous auriez dû ajouter des scripts MopaBootstrapBundle aux clés existantes. Essayez le compositeur suivant.json et de ré-exécuter php composer.phar install

{
    "name": "symfony/framework-standard-edition",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.1.*",
        "doctrine/orm": "2.2.*",
        "doctrine/doctrine-bundle": "dev-master",
        "twig/extensions": "dev-master",
        "symfony/assetic-bundle": "dev-master",
        "symfony/swiftmailer-bundle": "dev-master",
        "symfony/monolog-bundle": "dev-master",
        "sensio/distribution-bundle": "dev-master",
        "sensio/framework-extra-bundle": "dev-master",
        "sensio/generator-bundle": "dev-master",
        "jms/security-extra-bundle": "1.1.*",
        "jms/di-extra-bundle": "1.0.*",
        "ddeboer/guzzle-bundle": "dev-master",
        "mopa/bootstrap-bundle": "dev-master",
        "twitter/bootstrap": "master",
        "knplabs/knp-paginator-bundle": "dev-master",
        "knplabs/knp-menu-bundle": "dev-master",
        "craue/formflow-bundle": "dev-master"
    },
    "repositories": [
        {
            "type": "package",
            "package": {
                "version": "master",
                "name": "twitter/bootstrap",
                "source": {
                    "url": "https://github.com/twitter/bootstrap.git",
                    "type": "git",
                    "reference": "master"
                },
                "dist": {
                    "url": "https://github.com/twitter/bootstrap/zipball/master",
                    "type": "zip"
                }
            }
        }
    ],
    "scripts": {
        "post-install-cmd": [
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile",
            "Mopa\Bundle\BootstrapBundle\Composer\ScriptHandler::postInstallSymlinkTwitterBootstrap"
        ],
        "post-update-cmd": [
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile",
            "Mopa\Bundle\BootstrapBundle\Composer\ScriptHandler::postInstallSymlinkTwitterBootstrap"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "minimum-stability": "dev",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web"
    }
}
4
répondu mgiagnoni 2012-08-14 20:33:22