Skip to content

Commit

Permalink
Add console_write function
Browse files Browse the repository at this point in the history
  • Loading branch information
midnite81 committed Sep 10, 2018
1 parent c5e2ab4 commit 1171b2b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions composer.json
Expand Up @@ -24,6 +24,7 @@
"files": [
"src/Helpers/helpers.php",
"src/Helpers/carbon.php",
"src/Helpers/output.php",
"src/Helpers/uuid.php"
]
},
Expand Down
16 changes: 16 additions & 0 deletions src/Helpers/output.php
@@ -0,0 +1,16 @@
<?php

if ( ! function_exists('console_write')) {
/**
* Write a line to the console
*
* @param $string
*/
function console_write($string)
{
if (class_exists('Symfony\Component\Console\Output\ConsoleOutput')) {
$output = new Symfony\Component\Console\Output\ConsoleOutput();
$output->writeln($string);
}
}
}

4 comments on commit 1171b2b

@knash94
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done

@midnite81
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sixteenstudio
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want colours, can we have colours?

@midnite81
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has colours ... Learn your Symfony young man!

console_write('Haven\'t <comment>you</comment> done that <bg=black;fg=yellow>yet?</>')

Please sign in to comment.