Skip to content

Instantly share code, notes, and snippets.

@mAAdhaTTah
Last active April 30, 2019 18:36
Show Gist options
  • Save mAAdhaTTah/68b7fa1a5e9525b48e60 to your computer and use it in GitHub Desktop.
Save mAAdhaTTah/68b7fa1a5e9525b48e60 to your computer and use it in GitHub Desktop.
CMB2 as Composer Library
{
"require": {
"php": ">=5.3.0",
"composer/installers": "v1.0.12",
"webdevstudios/cmb2": "dev-master",
},
"autoload": {
"files": ["vendor/cmb2/init.php"]
},
"extra": {
"installer-paths": {
"vendor/{$name}/": ["webdevstudios/cmb2"]
}
}
}
@mAAdhaTTah
Copy link
Author

You can change vendor if you use a custom vendor-dir:

"config": {
  "vendor-dir": "lib"
}

@richardtape
Copy link

Thanks for putting this up. Saved me some time :)

@khromov
Copy link

khromov commented Jul 7, 2016

Awesome, thanks!

@jancbeck
Copy link

  [Seld\JsonLint\ParsingException]
  "./composer.json" does not contain valid JSON
  Parse error on line 5:
  ...2": "dev-master",  },  "autoload": {
  ---------------------^
  Expected: 'STRING' - It appears you have an extra trailing comma

@namncn
Copy link

namncn commented Sep 24, 2017

Just delete "," on line 5 to fix this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment