Skip to content

Instantly share code, notes, and snippets.

@cullymason
Forked from duellsy/artisan.php
Created April 4, 2014 21:47
Show Gist options
  • Save cullymason/9983737 to your computer and use it in GitHub Desktop.
Save cullymason/9983737 to your computer and use it in GitHub Desktop.
<?php
// Adding this to your app/artisan.php file will
// do a quick confirmation that you really do want
// to run this command when in production environment
if (App::environment() === 'production') {
echo "\033[0;33m======== WARNING ========\n";
echo "===== IN PRODUCTION =====\n";
echo "=========================\n";
echo "Are you sure you want to do this? (y/n)\033[0m ";
$line = fgets(STDIN);
if(trim($line) != 'y'){
echo "\033[0;32mABORTING... few!\033[0m\n";
exit;
}
echo "\n";
echo "\033[0;32mThank you, continuing...\033[0m\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment