public static function getInstance(sfEventDispatcher $dispatcher)
 {
     if (!self::$instance) {
         self::$instance = new sfSassCompilerArgs($dispatcher);
     }
     return self::$instance;
 }
 /**
  * @see sfTask
  */
 protected function execute($arguments = array(), $options = array())
 {
     $compiler = sfSassCompilerArgs::getInstance($this->dispatcher);
     $in = sfConfig::get('app_sfSassyCssPlugin_input_dir', sfConfig::get('sf_data_dir') . '/sass');
     $out = sfConfig::get('app_sfSassyCssPlugin_output_dir', sfConfig::get('sf_web_dir') . '/css');
     $params = array();
     // Clean
     if (!$options['no-clean']) {
         $this->logSection('Clean', 'remove previously generated css files');
         $compiler->clean($in, $out);
     }
     $params[] = '--no-cache';
     if (sfConfig::get('app_sfSassyCssPlugin_encoding') !== null) {
         $params[] = sprintf('-E "%s"', sfConfig::get('app_sfSassyCssPlugin_encoding'));
     }
     if ($options['format'] == 'scss') {
         $params[] = sprintf('--scss');
     }
     if ($options['debug']) {
         $params[] = '--debug-info';
         $params[] = '--line-numbers';
         $params[] = '--line-comments';
         $params[] = '--style expanded';
     } else {
         $params[] = sprintf('--style %s', $options['style']);
     }
     foreach (sfConfig::get('app_sfSassyCssPlugin_include_dirs') as $path) {
         $params[] = sprintf('--load-path "%s"', sfSassCompilerDriver::fixPath($path));
     }
     $compiler->compile($in, $out, null, $params);
     $this->logSection('Command', $compiler->getCommand());
     $stdout = $compiler->getStdOut();
     $status = $compiler->getStatus();
     if (!empty($stdout)) {
         $this->logBlock("\n" . $stdout . "\n", preg_match('/error /i', $stdout) !== 0 ? 'ERROR' : 'INFO');
     }
     $this->logSection('Status', $status);
 }