diff options
author | Laurent Bachelier <laurent@bachelier.name> | 2011-02-04 00:16:46 +0100 |
---|---|---|
committer | Laurent Bachelier <laurent@bachelier.name> | 2011-02-04 00:16:46 +0100 |
commit | fb4e54f09cd186a0b025ebb59f310be781abb5d9 (patch) | |
tree | 290fabe32e22d9dbfa8c5a548a128db0225df514 | |
parent | Rationalize the way to find the PHP CLI executable (diff) | |
download | symfttpd-1.1.0.tar.xz |
Colorize mksymlinks outputv1.1.0
-rwxr-xr-x | mksymlinks | 25 |
1 files changed, 20 insertions, 5 deletions
@@ -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; |