Skip to content

Instantly share code, notes, and snippets.

@tomzx
Last active January 21, 2016 01:45
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 tomzx/db75e50b219cb7fd69c0 to your computer and use it in GitHub Desktop.
Save tomzx/db75e50b219cb7fd69c0 to your computer and use it in GitHub Desktop.
Melody bootstrapper
<?php
<<<CONFIG
packages:
- "your/dependencies: 1.0"
CONFIG;
if ( ! file_exists('composer.phar')) {
file_put_contents('composer.phar', fopen('https://getcomposer.org/composer.phar', 'r'));
}
if ( ! file_exists('melody.phar')) {
file_put_contents('melody.phar', fopen('http://get.sensiolabs.org/melody.phar', 'r'));
}
if ( ! getenv('MELODY')) {
putenv('MELODY=1');
passthru('php '.APP_DIR.'/melody.phar run '.__FILE__.' -vvv');
exit;
}
// Your PHP code here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment