aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Bachelier <laurent@bachelier.name>2011-02-04 00:16:46 +0100
committerLaurent Bachelier <laurent@bachelier.name>2011-02-04 00:16:46 +0100
commitfb4e54f09cd186a0b025ebb59f310be781abb5d9 (patch)
tree290fabe32e22d9dbfa8c5a548a128db0225df514
parentRationalize the way to find the PHP CLI executable (diff)
downloadsymfttpd-fb4e54f09cd186a0b025ebb59f310be781abb5d9.tar.xz
Colorize mksymlinks outputv1.1.0
-rwxr-xr-xmksymlinks25
1 files changed, 20 insertions, 5 deletions
diff --git a/mksymlinks b/mksymlinks
index 9c0a0e4..fee8192 100755
--- a/mksymlinks
+++ b/mksymlinks
@@ -8,6 +8,7 @@ require(dirname(__FILE__).'/lib/FileTools.php');
require(dirname(__FILE__).'/lib/MultiConfig.php');
require(dirname(__FILE__).'/lib/Symfony.php');
require(dirname(__FILE__).'/lib/Argument.php');
+require(dirname(__FILE__).'/lib/Color.php');
/**
* @pram string $project_path Absolute project path
@@ -58,10 +59,18 @@ function find_plugins($project_path)
$options = MultiConfig::get();
+$options['color'] = !Argument::get('C', 'no-color', false) && posix_isatty(STDOUT);
+if ($options['color'])
+{
+ Color::enable();
+}
$project_path = Symfony::getProjectPath();
-log_message("Using symfony version ".$options['want']);
+log_message(Color::style('bright') . Color::fgColor('green')
+ . 'Using symfony version ' . Color::style('normal')
+ . Color::fgColor('yellow') . $options['want'] . Color::style('normal'));
+
$symlinks = array();
if ($options['genconf'])
{
@@ -89,11 +98,13 @@ foreach (array(
}
}
-log_message('Creating required directories...');
+log_message(Color::style('bright') . Color::fgColor('green')
+ . 'Creating required directories...' . Color::style('normal'));
FileTools::mkdirs($project_path.'/cache');
FileTools::mkdirs($project_path.'/log');
-log_message('Creating symbolic links...');
+log_message(Color::style('bright') . Color::fgColor('green')
+ . 'Creating symbolic links...' . Color::style('normal'));
foreach ($symlinks as $link => $target)
{
replace_symlink($project_path, $target, $link, $options['relative']);
@@ -102,7 +113,9 @@ if ($options['do_plugins'])
{
if (version_compare($options['want'], '1.2') >= 0)
{
- log_message('Creating symbolic links for plugins... (calling symfony)');
+ log_message(Color::style('bright') . Color::fgColor('green')
+ . 'Creating symbolic links for plugins... (calling symfony)'
+ . Color::style('normal'));
if (empty($options['php_cmd']))
{
$options['php_cmd'] = PosixTools::which('php');
@@ -111,7 +124,9 @@ if ($options['do_plugins'])
}
else
{
- log_message('Creating symbolic links for plugins... (internal method)');
+ log_message(Color::style('bright') . Color::fgColor('green')
+ . 'Creating symbolic links for plugins... (internal method)'
+ . Color::style('normal'));
foreach (find_plugins($project_path) as $name)
{
$link = 'web/'.$name;