symfony 2.1 - Solución de problemas "require_once(../ bootstrap.php.cache): no se pudo abrir la secuencia: no existe ese archivo o directorio"
symfony-2.1 (3)
Estoy intentando redistribuir un proyecto de Symfony 2.1x en el que he estado trabajando y app_dev.php
está fallando porque no puede encontrar la app/bootstrap.php.cache
. Este archivo se omite del repositorio de git del proyecto porque .gitignore
archivo .gitignore
recomendación de .gitignore
:
# .gitignore
/app/bootstrap*
¿Estoy en lo cierto al pensar que la app/bootstrap.php.cache
se genera durante el proceso de $ php composer.phar install
? Si este es el caso, incluiré para usted mi 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": [
"Sensio//Bundle//DistributionBundle//Composer//ScriptHandler::buildBootstrap",
"Sensio//Bundle//DistributionBundle//Composer//ScriptHandler::clearCache",
"Sensio//Bundle//DistributionBundle//Composer//ScriptHandler::installAssets",
"Sensio//Bundle//DistributionBundle//Composer//ScriptHandler::installRequirementsFile"
],
"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"
],
"post-install-cmd": [
"Mopa//Bundle//BootstrapBundle//Composer//ScriptHandler::postInstallSymlinkTwitterBootstrap"
],
"post-update-cmd": [
"Mopa//Bundle//BootstrapBundle//Composer//ScriptHandler::postInstallSymlinkTwitterBootstrap"
]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "dev",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web"
}
}
¿Cómo puedo generar bootstrap.php.cache
?
Ha duplicado post-install-cmd
y post-updated-cmd
mientras que debería haber agregado los scripts MopaBootstrapBundle a las claves existentes. Pruebe el siguiente composer.json y vuelva a ejecutar 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"
}
}
Simplemente ejecute el siguiente comando.
php composer.phar install
Fuente: http://symfony.com/doc/master/book/performance.html#use-bootstrap-files
Solo ve a tu proyecto y grábalo con un compositor como
php /path/to/composer/composer.phar install