Skip to content

Instantly share code, notes, and snippets.

@cmbuckley
Last active October 12, 2015 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmbuckley/4065842 to your computer and use it in GitHub Desktop.
Save cmbuckley/4065842 to your computer and use it in GitHub Desktop.
#!/usr/bin/env php
<?php
$filename = ($argc > 1 ? $argv[1] : 'composer.json');
$content = str_replace('\\\\', '\\\\\\\\', file_get_contents($filename));
if (null === ($dependencies = json_decode($content, true))) {
throw new Exception(json_last_error());
}
$dependencies['require']['friendsofsymfony/user-bundle'] = '*';
file_put_contents(
$filename,
str_replace('\\\\\\\\', '\\\\', json_encode($dependencies))
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment