Which MongoDBBundle version works with Symfony 2.1.6? - symfony-2.1

I am trying to install MongoDBBundle in symfony 2.1.6 using through this link
http://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/index.html
in tutorial they explained to add the following to composer.json
{
"require": {
"doctrine/mongodb-odm-bundle": "3.0.*"
},
"minimum-stability": "dev"
}
this is my 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.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.0.*",
"twig/extensions": "1.0.*#dev",
"symfony/assetic-bundle": "2.1.*",
"symfony/swiftmailer-bundle": "2.1.*",
"symfony/monolog-bundle": "2.1.*",
"sensio/distribution-bundle": "2.1.*",
"sensio/framework-extra-bundle": "2.1.*",
"sensio/generator-bundle": "2.1.*",
"jms/security-extra-bundle": "1.2.*",
"jms/di-extra-bundle": "1.1.*",
"kriswallsmith/assetic": "1.1.*#dev"
},
"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"
]
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web"
}
}
In this where I need to put the line to update composer.json

This should work, running smoothly on 2.1.4 and should work the same with yours in 2.1.6
{
"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.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.0.*",
"twig/extensions": "1.0.*#dev",
"symfony/assetic-bundle": "2.1.*",
"symfony/swiftmailer-bundle": "2.1.*",
"symfony/monolog-bundle": "2.1.*",
"sensio/distribution-bundle": "2.1.*",
"sensio/framework-extra-bundle": "2.1.*",
"sensio/generator-bundle": "2.1.*",
"jms/security-extra-bundle": "1.2.*",
"jms/di-extra-bundle": "1.1.*",
"kriswallsmith/assetic": "1.1.*#dev",
"doctrine/mongodb-odm-bundle": "3.0.*"
},
"minimum-stability": "dev",
"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"
]
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web"
}
}

Related

nguniversal is saying my schema is incorrect

ng add #nguniversal/express-engine --clientProject cookbook
When I run this command to make my application angular universal. I get errors telling me the schema is not valid
Error Message from Console
gettingstarted#gettingstarted:~/WebstormProjects/cookbook$ ng add #nguniversal/express-engine --clientProject cookbook
ℹ Using package manager: npm
✔ Found compatible package version: #nguniversal/express-engine#14.2.0.
✔ Package information loaded.
The package #nguniversal/express-engine#14.2.0 will be installed and executed.
Would you like to proceed? Yes
✔ Packages successfully installed.
Schematic input does not validate against the Schema: {"clientProject":"cookbook","project":"cookbook"}
Errors:
Data path "" must NOT have additional properties(clientProject).
gettingstarted#gettingstarted:~/WebstormProjects/cookbook$
Angular.json
{
"$schema": "./node_modules/#angular/cli/lib/config/schema.json",
"cli": {
"analytics": false
},
"version": 1,
"newProjectRoot": "projects",
"projects": {
"cookbook": {
"projectType": "application",
"schematics": {
"#schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "#angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/cookbook",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"./node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.css"
],
"scripts": [
"./node_modules/bootstrap/dist/js/bootstrap.min.js",
"./node_modules/jquery/dist/jquery.js",
"./node_modules/#popperjs/core/dist/umd/popper.min.js"
]
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "#angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "cookbook:build:production"
},
"development": {
"browserTarget": "cookbook:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "#angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "cookbook:build"
}
},
"test": {
"builder": "#angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
}
}
}
}
}
}

internal/modules/cjs/loader.js:456 throw e; ^ Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in

After I run npm start
This is my result is ...
> nodefirebase_curd#1.0.0 start
> nodemon index.js
[nodemon] 2.0.13
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node index.js`
internal/modules/cjs/loader.js:456
throw e;
^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in C:\Users\tong1\Desktop\test-Firebase\nodeFirebase_CURD\node_modules\firebase\package.json
at throwExportsNotFound (internal/modules/esm/resolve.js:285:9)
at packageExportsResolve (internal/modules/esm/resolve.js:508:3)
at resolveExports (internal/modules/cjs/loader.js:450:36)
at Function.Module._findPath (internal/modules/cjs/loader.js:490:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:888:27)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (C:\Users\tong1\Desktop\test-Firebase\nodeFirebase_CURD\db.js:1:18)
at Module._compile (internal/modules/cjs/loader.js:1085:14) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
[nodemon] app crashed - waiting for file changes before starting...
I never see this error before...
This is the file that error mentioned.
(This is \node_modules\firebase\package.json in my project.)
{
"name": "firebase",
"version": "9.1.0",
"description": "Firebase JavaScript library for web and Node.js",
"author": "Firebase <firebase-support#google.com> (https://firebase.google.com/)",
"license": "Apache-2.0",
"homepage": "https://firebase.google.com/",
"keywords": [
"authentication",
"database",
"Firebase",
"firebase",
"realtime",
"storage",
"performance",
"remote-config"
],
"files": [
"**/dist/",
"**/package.json",
"/firebase*.js",
"/firebase*.map",
"compat/index.d.ts"
],
"exports": {
"./analytics": {
"node": {
"require": "./analytics/dist/index.cjs.js",
"import": "./analytics/dist/index.mjs"
},
"default": "./analytics/dist/index.esm.js"
},
"./app": {
"node": {
"require": "./app/dist/index.cjs.js",
"import": "./app/dist/index.mjs"
},
"default": "./app/dist/index.esm.js"
},
"./app-check": {
"node": {
"require": "./app-check/dist/index.cjs.js",
"import": "./app-check/dist/index.mjs"
},
"default": "./app-check/dist/index.esm.js"
},
"./auth": {
"node": {
"require": "./auth/dist/index.cjs.js",
"import": "./auth/dist/index.mjs"
},
"default": "./auth/dist/index.esm.js"
},
"./auth/cordova": {
"node": {
"require": "./auth/cordova/dist/index.cjs.js",
"import": "./auth/cordova/dist/index.mjs"
},
"default": "./auth/cordova/dist/index.esm.js"
},
"./auth/react-native": {
"node": {
"require": "./auth/react-native/dist/index.cjs.js",
"import": "./auth/react-native/dist/index.mjs"
},
"default": "./auth/react-native/dist/index.esm.js"
},
"./database": {
"node": {
"require": "./database/dist/index.cjs.js",
"import": "./database/dist/index.mjs"
},
"default": "./database/dist/index.esm.js"
},
"./firestore": {
"node": {
"require": "./firestore/dist/index.cjs.js",
"import": "./firestore/dist/index.mjs"
},
"default": "./firestore/dist/index.esm.js"
},
"./firestore/lite": {
"node": {
"require": "./firestore/lite/dist/index.cjs.js",
"import": "./firestore/lite/dist/index.mjs"
},
"default": "./firestore/lite/dist/index.esm.js"
},
"./functions": {
"node": {
"require": "./functions/dist/index.cjs.js",
"import": "./functions/dist/index.mjs"
},
"default": "./functions/dist/index.esm.js"
},
"./messaging": {
"node": {
"require": "./messaging/dist/index.cjs.js",
"import": "./messaging/dist/index.mjs"
},
"default": "./messaging/dist/index.esm.js"
},
"./messaging/sw": {
"node": {
"require": "./messaging/sw/dist/index.cjs.js",
"import": "./messaging/sw/dist/index.mjs"
},
"default": "./messaging/sw/dist/index.esm.js"
},
"./performance": {
"node": {
"require": "./performance/dist/index.cjs.js",
"import": "./performance/dist/index.mjs"
},
"default": "./performance/dist/index.esm.js"
},
"./remote-config": {
"node": {
"require": "./remote-config/dist/index.cjs.js",
"import": "./remote-config/dist/index.mjs"
},
"default": "./remote-config/dist/index.esm.js"
},
"./storage": {
"node": {
"require": "./storage/dist/index.cjs.js",
"import": "./storage/dist/index.mjs"
},
"default": "./storage/dist/index.esm.js"
},
"./compat/analytics": {
"node": {
"require": "./compat/analytics/dist/index.cjs.js",
"import": "./compat/analytics/dist/index.mjs"
},
"default": "./compat/analytics/dist/index.esm.js"
},
"./compat/app": {
"node": {
"require": "./compat/app/dist/index.cjs.js",
"import": "./compat/app/dist/index.mjs"
},
"default": "./compat/app/dist/index.esm.js"
},
"./compat/app-check": {
"node": {
"require": "./compat/app-check/dist/index.cjs.js",
"import": "./compat/app-check/dist/index.mjs"
},
"default": "./compat/app-check/dist/index.esm.js"
},
"./compat/auth": {
"node": {
"require": "./compat/auth/dist/index.cjs.js",
"import": "./compat/auth/dist/index.mjs"
},
"default": "./compat/auth/dist/index.esm.js"
},
"./compat/database": {
"node": {
"require": "./compat/database/dist/index.cjs.js",
"import": "./compat/database/dist/index.mjs"
},
"default": "./compat/database/dist/index.esm.js"
},
"./compat/firestore": {
"node": {
"require": "./compat/firestore/dist/index.cjs.js",
"import": "./compat/firestore/dist/index.mjs"
},
"default": "./compat/firestore/dist/index.esm.js"
},
"./compat/functions": {
"node": {
"require": "./compat/functions/dist/index.cjs.js",
"import": "./compat/functions/dist/index.mjs"
},
"default": "./compat/functions/dist/index.esm.js"
},
"./compat/messaging": {
"node": {
"require": "./compat/messaging/dist/index.cjs.js",
"import": "./compat/messaging/dist/index.mjs"
},
"default": "./compat/messaging/dist/index.esm.js"
},
"./compat/performance": {
"node": {
"require": "./compat/performance/dist/index.cjs.js",
"import": "./compat/performance/dist/index.mjs"
},
"default": "./compat/performance/dist/index.esm.js"
},
"./compat/remote-config": {
"node": {
"require": "./compat/remote-config/dist/index.cjs.js",
"import": "./compat/remote-config/dist/index.mjs"
},
"default": "./compat/remote-config/dist/index.esm.js"
},
"./compat/storage": {
"node": {
"require": "./compat/storage/dist/index.cjs.js",
"import": "./compat/storage/dist/index.mjs"
},
"default": "./compat/storage/dist/index.esm.js"
}
},
"repository": {
"type": "git",
"url": "https://github.com/firebase/firebase-js-sdk.git"
},
"scripts": {
"build": "rollup -c && gulp cdn-type-module-path && yarn build:compat",
"build:compat": "rollup -c compat/rollup.config.js",
"dev": "rollup -c -w",
"test": "echo 'No test suite for firebase wrapper'",
"test:ci": "echo 'No test suite for firebase wrapper'"
},
"dependencies": {
"#firebase/app": "0.7.1",
"#firebase/app-compat": "0.1.2",
"#firebase/app-types": "0.7.0",
"#firebase/auth": "0.18.0",
"#firebase/auth-compat": "0.1.3",
"#firebase/database": "0.12.1",
"#firebase/database-compat": "0.1.1",
"#firebase/firestore": "3.1.0",
"#firebase/firestore-compat": "0.1.3",
"#firebase/functions": "0.7.2",
"#firebase/functions-compat": "0.1.3",
"#firebase/installations": "0.5.1",
"#firebase/messaging": "0.9.1",
"#firebase/messaging-compat": "0.1.1",
"#firebase/polyfill": "0.3.36",
"#firebase/storage": "0.8.3",
"#firebase/storage-compat": "0.1.3",
"#firebase/performance": "0.5.1",
"#firebase/performance-compat": "0.1.1",
"#firebase/remote-config": "0.3.0",
"#firebase/remote-config-compat": "0.1.1",
"#firebase/analytics": "0.7.1",
"#firebase/analytics-compat": "0.1.2",
"#firebase/app-check": "0.4.1",
"#firebase/app-check-compat": "0.1.2",
"#firebase/util": "1.4.0"
},
"devDependencies": {
"rollup": "2.56.3",
"#rollup/plugin-commonjs": "20.0.0",
"#rollup/plugin-node-resolve": "13.0.4",
"rollup-plugin-sourcemaps": "0.6.3",
"rollup-plugin-terser": "7.0.2",
"rollup-plugin-typescript2": "0.30.0",
"rollup-plugin-uglify": "6.0.4",
"gulp": "4.0.2",
"gulp-sourcemaps": "3.0.0",
"gulp-replace": "1.1.3",
"typescript": "4.2.2"
},
"components": [
"analytics",
"app",
"app-check",
"auth",
"auth/cordova",
"auth/react-native",
"functions",
"firestore",
"firestore/lite",
"storage",
"performance",
"remote-config",
"messaging",
"messaging/sw",
"database"
]
}
Another one.
(This is .js file.)
const firebase = require('firebase');
const config = require('./config');
const db = firebase.initializeApp(config.firebaseConfig);
module.exports = db;
I try to fix it with myself but I don't know where to fix it.
I try to search this problem on internet but I'm not found.
What should I do. Can you help me, please.
If you what to see more you can tell me.
Thank you so much.
chnage the .js file to
const { initializeApp } = require('firebase/app')
const config = require('./config');
const db = initializeApp(config.firebaseConfig);
module.exports = db;
refer to firebase

Error importing a user js file using electron-builder

I have an electron application with main process as follows:
const {app, BrowserWindow, Menu, dialog} = require('electron');
const path = require('path')
let logConfig = require('./js/loggConfig.js');
....
This executes perfectly when run directly from terminal.
But when I package this project using electron-builder, and install it on another machine (Windows 10), I get the following error while launching the app:
Error: Cannot find module '.js/loggConfig.js'
How do I resolve this?
Here is how my package.json looks like:
{
"name": "ABCD",
"version": "0.0.1",
"description": "...",
"author": "abcd <abcd#gmail.com>",
"homepage": "http://www.abcd.com",
"main": "main_electron.js",
"scripts": {
"postinstall": "install-app-deps",
"start": "electron .",
"dist": "build"
},
"build": {
"appId": "yourappid",
"dmg": {
"contents": [
{
"x": 110,
"y": 150
},
{
"x": 240,
"y": 150,
"type": "link",
"path": "/Applications"
}
]
},
"linux": {
"target": [
"AppImage",
"deb"
],
"category": "Video"
},
"win": {
"target": "NSIS",
"icon": "build/icon.ico",
"extraResources": [
]
}
},
"dependencies": {
"electron-context-menu": "^0.9.1",
"electron-log": "^2.2.13",
"fs": "0.0.1-security",
"mkdirp": "^0.5.1",
"path": "^0.12.7",
"uuid": "^3.1.0",
"xmlbuilder": "^9.0.4",
"zip-folder": "^1.0.0"
},
"devDependencies": {
"electron": "^1.7.9",
"electron-builder": "^19.49.0"
}
}
I solved the issue changing the build configuration.
Setting asar to false.
Setting asarUnpack to export all the asar content with "**/*".
"build": {
"appId": "app.node.electron",
"productName": "app electron",
"asar":false,
"asarUnpack":[
"**/*"
],
"directories": {
"output": "release"
},
"win": {
"publisherName": "app electron",
"icon": "icon.png",
"target": [
"nsis"
]
},
},

Unable to resolve 'Microsoft.WindowsAzure.Storage (>= 7.2.0)' for '.NETCoreApp,Version=v1.0'

I try to use Windows Azure Storage inside my dotnet core system (my first dotnet core project). I tried the unit test for Azure Storage with dotnet core and it builds well.
But when I try to include the dependency to Azure Storage in my project.json, I receive this message:
Unable to resolve 'Microsoft.WindowsAzure.Storage (>= 7.2.0)' for '.NETCoreApp,Version=v1.0'.
Here is my full project.json file
{
"dependencies": {
"Microsoft.AspNetCore.Mvc": "1.0.*",
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.*",
"Microsoft.AspNetCore.Server.IISIntegration":"1.0.*",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.*",
"Microsoft.AspNetCore.Diagnostics": "1.0.*",
"Microsoft.Extensions.Configuration.EnvironmentVariables":"1.0.*",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.*",
"Microsoft.Extensions.Configuration.Json": "1.0.*",
"Microsoft.Extensions.Configuration.CommandLine": "1.0.0",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0",
"Microsoft.Extensions.Logging":"1.0.*",
"Microsoft.Extensions.Logging.Console": "1.0.*",
"Microsoft.Extensions.Logging.Debug": "1.0.*",
"Microsoft.EntityFrameworkCore": "1.0.*",
"Microsoft.EntityFrameworkCore.Sqlite": "1.0.*",
"Microsoft.EntityFrameworkCore.Design": { "version": "1.0.0-preview2-final", "type": "build" },
"Autofac": "4.0.0-rc3-309",
"Autofac.Extensions.DependencyInjection": "4.0.0-rc3-309",
"FluentValidation": "6.4.0-beta3",
// "Serilog" : "2.0.0",
// "Serilog.Extensions.Logging" : "1.0.0",
// "Serilog.Sinks.Console" : "2.0.0"
"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",
"Microsoft.AspNetCore.Razor.Tools": { "version": "1.0.0-preview2-final", "type": "build" },
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
"version": "1.0.0-preview2-final",
"type": "build"
},
"Microsoft.WindowsAzure.Storage": "7.2.0.0-*"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview2-final",
"imports": "portable-net45+win8+dnxcore50"
},
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
"Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
"BundlerMinifier.Core": "2.0.238",
"Microsoft.Extensions.SecretManager.Tools": "1.0.0-preview2-final",
"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
"version": "1.0.0-preview2-final",
"imports": [
"portable-net45+win8"
]
}
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
}
},
"imports": [
// "dotnet5.6",
"dnxcore50",
"portable-net45+win8"
]
}
},
"buildOptions": {
"define": [ "NETCORE"],
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"gcServer": true
},
"publishOptions": {
"include": [
"wwwroot",
"Views",
"Areas/**/Views",
"appsettings.json",
"web.config"
]
},
"scripts": {
"precompile": [ "dotnet bundle" ],
"prepublish": [ "bower install" ],
"postpublish": [
"dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
]
},
"tooling": {
"defaultNamespace": "Wod6000"
}
}
Do you have an idea on what is wrong?
Our package is named WindowsAzure.Storage. Can you try that instead?

Troubleshooting "require_once(../bootstrap.php.cache): failed to open stream: No such file or directory"

I am trying to redeploy a Symfony 2.1x project I have been working on and app_dev.php is failing because it can't find app/bootstrap.php.cache. This file is omitted from the project's git repository because I used Symfony2's recommend .gitignore file:
# .gitignore
/app/bootstrap*
Am I correct in thinking that app/bootstrap.php.cache is generated during the $ php composer.phar install process? If this is the case then I will include for you my 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"
}
}
How can I generate bootstrap.php.cache?
Just go to your project and generate it with composer like
php /path/to/composer/composer.phar install
Just run the following command.
php composer.phar install
Source: http://symfony.com/doc/master/book/performance.html#use-bootstrap-files
You have duplicated post-install-cmd and post-updated-cmd while you should have added MopaBootstrapBundle scripts to existing keys. Try the following composer.json and re-run 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"
}
}
In my case, my composer version was 2.x and the required version was 1.x
so, first i needed to downgrade to version 1 and then i run composer install
sudo composer self-update --1 && composer install -v --prefer-dist

Resources