public function initialize(sfEventDispatcher $dispatcher, $options = array()) { $options = array_merge(array('steps' => 100, 'text' => '', 'delim' => '*', 'maxchars' => 70), $options); $this->steps = abs($options['steps']); $this->step = 0; $this->text = $options['text']; $this->delim = $options['delim']; $this->maxchars = $options['maxchars']; parent::initialize($dispatcher, $options); }
/** * Initializes this logger. * * @param sfEventDispatcher $dispatcher A sfEventDispatcher instance * @param array $options An array of options. */ public function initialize(sfEventDispatcher $dispatcher, $options = array()) { $dispatcher->connect('command.log', array($this, 'listenToLogEvent')); return parent::initialize($dispatcher, $options); }
<?php /* * This file is part of the symfony package. * (c) 2004-2006 Fabien Potencier <*****@*****.**> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ require_once dirname(__FILE__) . '/../../bootstrap/unit.php'; $t = new lime_test(1); $logger = new sfConsoleLogger(new sfEventDispatcher()); $logger->setStream($buffer = fopen('php://memory', 'rw')); $logger->log('foo'); rewind($buffer); $t->is(fix_linebreaks(stream_get_contents($buffer)), "foo\n", 'sfConsoleLogger logs messages to the console');