Changeset 7397
- Timestamp:
- 02/08/08 07:48:35 (7 months ago)
- Files:
-
- branches/1.1/lib/plugins/sfPropelPlugin/lib/task/sfPropelBaseTask.class.php (modified) (5 diffs)
- branches/1.1/lib/plugins/sfPropelPlugin/lib/task/sfPropelBuildFormsTask.class.php (modified) (1 diff)
- branches/1.1/lib/plugins/sfPropelPlugin/lib/task/sfPropelBuildModelTask.class.php (modified) (1 diff)
- branches/1.1/lib/plugins/sfPropelPlugin/lib/task/sfPropelDataDumpTask.class.php (modified) (1 diff)
- branches/1.1/lib/plugins/sfPropelPlugin/lib/task/sfPropelDataLoadTask.class.php (modified) (1 diff)
- branches/1.1/lib/task/help/sfHelpTask.class.php (modified) (1 diff)
- branches/1.1/lib/task/help/sfListTask.class.php (modified) (1 diff)
- branches/1.1/lib/task/i18n/sfI18nExtractTask.class.php (modified) (5 diffs)
- branches/1.1/lib/task/i18n/sfI18nFindTask.class.php (modified) (2 diffs)
- branches/1.1/lib/task/plugin/sfPluginAddChannelTask.class.php (modified) (1 diff)
- branches/1.1/lib/task/plugin/sfPluginInstallTask.class.php (modified) (1 diff)
- branches/1.1/lib/task/plugin/sfPluginListTask.class.php (modified) (1 diff)
- branches/1.1/lib/task/plugin/sfPluginUninstallTask.class.php (modified) (1 diff)
- branches/1.1/lib/task/plugin/sfPluginUpgradeTask.class.php (modified) (1 diff)
- branches/1.1/lib/task/project/sfProjectDeployTask.class.php (modified) (1 diff)
- branches/1.1/lib/task/project/sfProjectDisableTask.class.php (modified) (1 diff)
- branches/1.1/lib/task/project/sfProjectEnableTask.class.php (modified) (1 diff)
- branches/1.1/lib/task/project/sfProjectFreezeTask.class.php (modified) (1 diff)
- branches/1.1/lib/task/project/upgrade1.1/sfAutoloadingUpgrade.class.php (modified) (2 diffs)
- branches/1.1/lib/task/project/upgrade1.1/sfComponentUpgrade.class.php (modified) (1 diff)
- branches/1.1/lib/task/project/upgrade1.1/sfConfigUpgrade.class.php (modified) (1 diff)
- branches/1.1/lib/task/project/upgrade1.1/sfEnvironmentUpgrade.class.php (modified) (1 diff)
- branches/1.1/lib/task/project/upgrade1.1/sfFactoriesUpgrade.class.php (modified) (1 diff)
- branches/1.1/lib/task/project/upgrade1.1/sfFlashUpgrade.class.php (modified) (3 diffs)
- branches/1.1/lib/task/project/upgrade1.1/sfLoggerUpgrade.class.php (modified) (1 diff)
- branches/1.1/lib/task/project/upgrade1.1/sfPropelUpgrade.class.php (modified) (2 diffs)
- branches/1.1/lib/task/project/upgrade1.1/sfSingletonUpgrade.class.php (modified) (3 diffs)
- branches/1.1/lib/task/project/upgrade1.1/sfWebDebugUpgrade.class.php (modified) (1 diff)
- branches/1.1/lib/task/sfFilesystem.class.php (modified) (13 diffs)
- branches/1.1/lib/task/sfTask.class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/plugins/sfPropelPlugin/lib/task/sfPropelBaseTask.class.php
r7394 r7397 64 64 $dbSchema->loadXML($schema); 65 65 66 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('schema', sprintf('converting "%s" to YML', $schema)))));66 $this->log('schema', sprintf('converting "%s" to YML', $schema)); 67 67 68 68 $localprefix = $prefix; … … 78 78 79 79 $file = str_replace(basename($schema), $prefix.$yml_file_name, $schema); 80 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('schema', 'putting '.$file))));80 $this->log('schema', sprintf('putting %s', $file)); 81 81 file_put_contents($file, $dbSchema->asYAML()); 82 82 } … … 114 114 foreach ($customSchemas as $customSchema) 115 115 { 116 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('schema', sprintf('found custom schema %s', $customSchema)))));116 $this->log('schema', sprintf('found custom schema %s', $customSchema)); 117 117 118 118 $customSchemaArray = sfYaml::load($customSchema); … … 127 127 $dbSchema->loadArray($schemaArray); 128 128 129 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('schema', sprintf('converting "%s" to XML', $schema)))));129 $this->log('schema', sprintf('converting "%s" to XML', $schema)); 130 130 131 131 $localprefix = $prefix; … … 141 141 142 142 $file = str_replace(basename($schema), $localprefix.$xml_file_name, $schema); 143 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('schema', 'putting '.$file))));143 $this->log('schema', sprintf('putting %s', $file)); 144 144 file_put_contents($file, $dbSchema->asXML()); 145 145 } branches/1.1/lib/plugins/sfPropelPlugin/lib/task/sfPropelBuildFormsTask.class.php
r7247 r7397 59 59 protected function execute($arguments = array(), $options = array()) 60 60 { 61 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('propel', 'generating form classes'))));61 $this->log('propel', 'generating form classes'); 62 62 63 63 $generatorManager = new sfGeneratorManager(); branches/1.1/lib/plugins/sfPropelPlugin/lib/task/sfPropelBuildModelTask.class.php
r7247 r7397 59 59 $this->cleanup(); 60 60 61 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('autoload', 'reloading autoloading'))));61 $this->log('autoload', 'reloading autoloading'); 62 62 63 63 sfSimpleAutoload::getInstance()->reload(); branches/1.1/lib/plugins/sfPropelPlugin/lib/task/sfPropelDataDumpTask.class.php
r7247 r7397 79 79 } 80 80 81 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('propel', sprintf('dumping data to "%s"', $filename)))));81 $this->log('propel', sprintf('dumping data to "%s"', $filename)); 82 82 83 83 $data = new sfPropelData(); branches/1.1/lib/plugins/sfPropelPlugin/lib/task/sfPropelDataLoadTask.class.php
r7333 r7397 101 101 } 102 102 103 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('propel', sprintf('load data from "%s"', $fixturesDir)))));103 $this->log('propel', sprintf('load data from "%s"', $fixturesDir)); 104 104 $data->loadData($fixturesDir, $options['connection']); 105 105 } branches/1.1/lib/task/help/sfHelpTask.class.php
r6931 r7397 100 100 } 101 101 102 $this-> dispatcher->notify(new sfEvent($this, 'command.log', $messages));102 $this->log($messages); 103 103 } 104 104 } branches/1.1/lib/task/help/sfListTask.class.php
r6931 r7397 101 101 } 102 102 103 $this-> dispatcher->notify(new sfEvent($this, 'command.log', $messages));103 $this->log($messages); 104 104 } 105 105 } branches/1.1/lib/task/i18n/sfI18nExtractTask.class.php
r6931 r7397 84 84 $this->bootstrapSymfony($arguments['application'], 'dev', true); 85 85 86 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('i18n', sprintf('extracting i18n strings for the "%s" application', $arguments['application'])))));86 $this->logSection('i18n', sprintf('extracting i18n strings for the "%s" application', $arguments['application'])); 87 87 88 88 $extract = new sfI18nApplicationExtract(); … … 90 90 $extract->extract(); 91 91 92 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('i18n', sprintf('found "%d" new i18n strings', count($extract->getNewMessages()))))));93 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('i18n', sprintf('found "%d" old i18n strings', count($extract->getOldMessages()))))));92 $this->logSection('i18n', sprintf('found "%d" new i18n strings', count($extract->getNewMessages()))); 93 $this->logSection('i18n', sprintf('found "%d" old i18n strings', count($extract->getOldMessages()))); 94 94 95 95 if ($options['display-new']) 96 96 { 97 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('i18n', sprintf('display new i18n strings', count($extract->getOldMessages()))))));97 $this->logSection('i18n', sprintf('display new i18n strings', count($extract->getOldMessages()))); 98 98 foreach ($extract->getNewMessages() as $message) 99 99 { 100 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array(' '.$message."\n")));100 $this->log(' '.$message."\n"); 101 101 } 102 102 } … … 104 104 if ($options['auto-save']) 105 105 { 106 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('i18n', 'saving new i18n strings'))));106 $this->logSection('i18n', 'saving new i18n strings'); 107 107 108 108 $extract->saveNewMessages(); … … 111 111 if ($options['display-old']) 112 112 { 113 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('i18n', sprintf('display old i18n strings', count($extract->getOldMessages()))))));113 $this->logSection('i18n', sprintf('display old i18n strings', count($extract->getOldMessages()))); 114 114 foreach ($extract->getOldMessages() as $message) 115 115 { 116 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array(' '.$message."\n")));116 $this->log(' '.$message."\n"); 117 117 } 118 118 } … … 120 120 if ($options['auto-delete']) 121 121 { 122 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('i18n', 'deleting old i18n strings'))));122 $this->logSection('i18n', 'deleting old i18n strings'); 123 123 124 124 $extract->deleteOldMessages(); branches/1.1/lib/task/i18n/sfI18nFindTask.class.php
r6931 r7397 45 45 public function execute($arguments = array(), $options = array()) 46 46 { 47 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('i18n', sprintf('find non "i18n ready" strings in the "%s" application', $arguments['application'])))));47 $this->logSection('i18n', sprintf('find non "i18n ready" strings in the "%s" application', $arguments['application'])); 48 48 49 49 sfCore::initDirectoryLayout(sfConfig::get('sf_root_dir'), $arguments['application'], $options['env']); … … 98 98 foreach ($templateStrings as $template => $messages) 99 99 { 100 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('i18n', sprintf('strings in "%s:%s"', $moduleName, $template)))));100 $this->logSection('i18n', sprintf('strings in "%s:%s"', $moduleName, $template)); 101 101 foreach ($messages as $message) 102 102 { 103 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array(" $message\n")));103 $this->log(" $message\n"); 104 104 } 105 105 } branches/1.1/lib/task/plugin/sfPluginAddChannelTask.class.php
r7247 r7397 47 47 protected function execute($arguments = array(), $options = array()) 48 48 { 49 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('plugin', sprintf('add channel "%s"', $arguments['name'])))));49 $this->logSection('plugin', sprintf('add channel "%s"', $arguments['name'])); 50 50 51 51 $this->getPluginManager()->registerChannel($arguments['name']); branches/1.1/lib/task/plugin/sfPluginInstallTask.class.php
r7247 r7397 93 93 protected function execute($arguments = array(), $options = array()) 94 94 { 95 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('plugin', sprintf('installing plugin "%s"', $arguments['name'])))));95 $this->logSection('plugin', sprintf('installing plugin "%s"', $arguments['name'])); 96 96 97 97 $this->getPluginManager()->installPlugin($arguments['name'], $options); branches/1.1/lib/task/plugin/sfPluginListTask.class.php
r7247 r7397 46 46 protected function execute($arguments = array(), $options = array()) 47 47 { 48 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->format('Installed plugins:', 'COMMENT'))));48 $this->log($this->formatter->format('Installed plugins:', 'COMMENT')); 49 49 50 50 foreach ($this->getPluginManager()->getInstalledPlugins() as $package) 51 51 { 52 52 $alias = $this->getPluginManager()->getRegistry()->getChannel($package->getChannel())->getAlias(); 53 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array(sprintf(' %-40s %10s-%-6s %s', $this->formatter->format($package->getPackage(), 'INFO'), $package->getVersion(), $package->getState() ? $package->getState() : null, $this->formatter->format(sprintf('# %s (%s)', $package->getChannel(), $alias), 'COMMENT')))));53 $this->log(sprintf(' %-40s %10s-%-6s %s', $this->formatter->format($package->getPackage(), 'INFO'), $package->getVersion(), $package->getState() ? $package->getState() : null, $this->formatter->format(sprintf('# %s (%s)', $package->getChannel(), $alias), 'COMMENT'))); 54 54 } 55 55 } branches/1.1/lib/task/plugin/sfPluginUninstallTask.class.php
r7247 r7397 68 68 protected function execute($arguments = array(), $options = array()) 69 69 { 70 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('plugin', sprintf('uninstalling plugin "%s"', $arguments['name'])))));70 $this->logSection('plugin', sprintf('uninstalling plugin "%s"', $arguments['name'])); 71 71 72 72 $this->getPluginManager()->uninstallPlugin($arguments['name'], $options); branches/1.1/lib/task/plugin/sfPluginUpgradeTask.class.php
r7247 r7397 61 61 protected function execute($arguments = array(), $options = array()) 62 62 { 63 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('plugin', sprintf('upgrading plugin "%s"', $arguments['name'])))));63 $this->logSection('plugin', sprintf('upgrading plugin "%s"', $arguments['name'])); 64 64 65 65 $this->getPluginManager()->installPlugin($arguments['name'], $options); branches/1.1/lib/task/project/sfProjectDeployTask.class.php
r6931 r7397 146 146 $dryRun = $options['go'] ? '' : '--dry-run'; 147 147 148 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->filesystem->sh("rsync --progress $dryRun $parameters -e $ssh ./ $user$host:$dir"))));148 $this->log($this->filesystem->sh("rsync --progress $dryRun $parameters -e $ssh ./ $user$host:$dir")); 149 149 } 150 150 } branches/1.1/lib/task/project/sfProjectDisableTask.class.php
r7335 r7397 50 50 51 51 $lockFile = $app.'_'.$env.'.lck'; 52 if ( !file_exists(sfConfig::get('sf_cache_dir').'/'.$lockFile))52 if (file_exists(sfConfig::get('sf_cache_dir').'/'.$lockFile)) 53 53 { 54 $this->filesystem->touch($lockFile); 54 $this->logSection('enable', sprintf('%s [%s] is currently DISABLED', $app, $env)); 55 } 55 56 56 $this->dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('enable', "$app [$env] has been DISABLED")))); 57 } 58 else 59 { 60 $this->dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('enable', "$app [$env] is currently DISABLED")))); 61 } 57 $this->filesystem->touch($lockFile); 58 59 $this->logSection('enable', sprintf('%s [%s] has been DISABLED', $app, $env)); 62 60 } 63 61 } branches/1.1/lib/task/project/sfProjectEnableTask.class.php
r7335 r7397 50 50 51 51 $lockFile = $app.'_'.$env.'.lck'; 52 if ( file_exists(sfConfig::get('sf_cache_dir').'/'.$lockFile))52 if (!file_exists(sfConfig::get('sf_cache_dir').'/'.$lockFile)) 53 53 { 54 $this->filesystem->remove($lockFile); 54 $this->logSection('enable', sprintf('%s [%s] is currently ENABLED', $app, $env)); 55 } 55 56 56 $clearCache = new sfCacheClearTask($this->dispatcher, $this->formatter); 57 $clearCache->run(); 57 $this->filesystem->remove($lockFile); 58 58 59 $this->dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('enable', "$app [$env] has been ENABLED")))); 60 } 61 else 62 { 63 $this->dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('enable', "$app [$env] is currently ENABLED")))); 64 } 59 $clearCache = new sfCacheClearTask($this->dispatcher, $this->formatter); 60 $clearCache->run(); 61 62 $this->logSection('enable', sprintf('%s [%s] has been ENABLED', $app, $env)); 65 63 } 66 64 } branches/1.1/lib/task/project/sfProjectFreezeTask.class.php
r7332 r7397 73 73 $symfony_data_dir = $arguments['symfony_data_dir']; 74 74 75 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('freeze', 'freezing lib found in "'.$symfony_lib_dir.'"'))));76 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('freeze', 'freezing data found in "'.$symfony_data_dir.'"'))));75 $this->logSection('freeze', sprintf('freezing lib found in "%s', $symfony_lib_dir)); 76 $this->logSection('freeze', sprintf('freezing data found in "%s"', $symfony_data_dir)); 77 77 78 78 $this->filesystem->mkdirs('lib'.DIRECTORY_SEPARATOR.'symfony'); branches/1.1/lib/task/project/upgrade1.1/sfAutoloadingUpgrade.class.php
r7333 r7397 31 31 $content = str_replace("'sfAutoload'", 'sfAutoload::getInstance()', $content); 32 32 33 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('config.php', sprintf('Migrating %s', $file)))));33 $this->logSection('config.php', sprintf('Migrating %s', $file)); 34 34 file_put_contents($file, $content); 35 35 } … … 47 47 EOF; 48 48 49 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('config.php', sprintf('Migrating %s', $file)))));49 $this->logSection('config.php', sprintf('Migrating %s', $file)); 50 50 file_put_contents($file, $content); 51 51 } branches/1.1/lib/task/project/upgrade1.1/sfComponentUpgrade.class.php
r7333 r7397 33 33 if ($count) 34 34 { 35 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('component', sprintf('Migrating %s', $file)))));35 $this->logSection('component', sprintf('Migrating %s', $file)); 36 36 file_put_contents($file, $content); 37 37 } branches/1.1/lib/task/project/upgrade1.1/sfConfigUpgrade.class.php
r7322 r7397 28 28 if ($count) 29 29 { 30 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('config', sprintf('Migrating %s', $file)))));30 $this->logSection('config', sprintf('Migrating %s', $file)); 31 31 file_put_contents($file, $content); 32 32 } branches/1.1/lib/task/project/upgrade1.1/sfEnvironmentUpgrade.class.php
r6931 r7397 39 39 if ($count) 40 40 { 41 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('environment', sprintf('Migrating %s', $file)))));41 $this->logSection('environment', sprintf('Migrating %s', $file)); 42 42 file_put_contents($file, $content); 43 43 } branches/1.1/lib/task/project/upgrade1.1/sfFactoriesUpgrade.class.php
r6931 r7397 32 32 $content = preg_replace('/^((.+)automatic_cleaning_factor:(\s+)(.+?))$/m', "$1\n$2prefix:$3 %SF_APP_DIR%", $content); 33 33 34 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('factories.yml', sprintf('Migrating %s', $file)))));34 $this->logSection('factories.yml', sprintf('Migrating %s', $file)); 35 35 file_put_contents($file, $content); 36 36 } branches/1.1/lib/task/project/upgrade1.1/sfFlashUpgrade.class.php
r6931 r7397 39 39 if ($count) 40 40 { 41 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('flash', sprintf('Migrating %s', $file)))));41 $this->logSection('flash', sprintf('Migrating %s', $file)); 42 42 file_put_contents($file, $content); 43 43 } … … 58 58 if ($count) 59 59 { 60 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('flash', sprintf('Migrating %s', $file)))));60 $this->logSection('flash', sprintf('Migrating %s', $file)); 61 61 file_put_contents($file, $content); 62 62 } … … 73 73 if ($count) 74 74 { 75 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('flash', sprintf('Migrating %s', $file)))));75 $this->logSection('flash', sprintf('Migrating %s', $file)); 76 76 file_put_contents($file, $content); 77 77 } branches/1.1/lib/task/project/upgrade1.1/sfLoggerUpgrade.class.php
r6931 r7397 29 29 if ($count) 30 30 { 31 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('logger', sprintf('Migrating %s', $file)))));31 $this->logSection('logger', sprintf('Migrating %s', $file)); 32 32 file_put_contents($file, $content); 33 33 } branches/1.1/lib/task/project/upgrade1.1/sfPropelUpgrade.class.php
r6931 r7397 28 28 if ($count) 29 29 { 30 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('propel', sprintf('Migrating %s', $file)))));30 $this->logSection('propel', sprintf('Migrating %s', $file)); 31 31 file_put_contents($file, $content); 32 32 } … … 43 43 44 44 EOF; 45 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('propel', sprintf('Migrating %s', $file)))));45 $this->logSection('propel', sprintf('Migrating %s', $file)); 46 46 file_put_contents($file, $content); 47 47 } branches/1.1/lib/task/project/upgrade1.1/sfSingletonUpgrade.class.php
r6931 r7397 40 40 if ($count) 41 41 { 42 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('singleton', sprintf('Migrating %s', $file)))));42 $this->logSection('singleton', sprintf('Migrating %s', $file)); 43 43 file_put_contents($file, $content); 44 44 } … … 69 69 .$content; 70 70 71 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('factories.yml', sprintf('Migrating %s', $file)))));71 $this->logSection('factories.yml', sprintf('Migrating %s', $file)); 72 72 file_put_contents($file, $content); 73 73 } … … 87 87 $content = preg_replace('/(prod\:\s+\.settings\:)/s', "$1\n logging_enabled: off", $content); 88 88 89 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('settings.yml', sprintf('Migrating %s', $file)))));89 $this->logSection('settings.yml', sprintf('Migrating %s', $file)); 90 90 file_put_contents($file, $content); 91 91 } branches/1.1/lib/task/project/upgrade1.1/sfWebDebugUpgrade.class.php
r6931 r7397 28 28 if ($count) 29 29 { 30 $this-> dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection('web_debug', sprintf('Migrating %s', $file)))));30 $this->logSection('web_debug', sprintf('Migrating %s', $file)); 31 31 file_put_contents($file, $content); 32 32 } branches/1.1/lib/task/sfFilesystem.class.php
r5250 r7397 71 71 if ($options['override'] || !file_exists($targetFile) || $mostRecent) 72 72 { 73 $this->log ('file+', $targetFile);73 $this->logSection('file+', $targetFile); 74 74 copy($originFile, $targetFile); 75 75 } … … 91 91 } 92 92 93 $this->log ('dir+', $path);93 $this->logSection('dir+', $path); 94 94 95 95 return @mkdir($path, $mode, true); … … 110 110 foreach ($files as $file) 111 111 { 112 $this->log ('file+', $file);112 $this->logSection('file+', $file); 113 113 114 114 touch($file); … … 133 133 if (is_dir($file) && !is_link($file)) 134 134 { 135 $this->log ('dir-', $file);135 $this->logSection('dir-', $file); 136 136 137 137 rmdir($file); … … 139 139 else 140 140 { 141 $this->log (is_link($file) ? 'link-' : 'file-', $file);141 $this->logSection(is_link($file) ? 'link-' : 'file-', $file); 142 142 143 143 unlink($file); … … 165 165 foreach ($files as $file) 166 166 { 167 $this->log (sprintf('chmod %o', $mode), $file);167 $this->logSection(sprintf('chmod %o', $mode), $file); 168 168 chmod($file, $mode); 169 169 } … … 186 186 } 187 187 188 $this->log ('rename', $origin.' > '.$target);188 $this->logSection('rename', $origin.' > '.$target); 189 189 rename($origin, $target); 190 190 } … … 221 221 if (!$ok) 222 222 { 223 $this->log ('link+', $targetDir);223 $this->logSection('link+', $targetDir); 224 224 symlink($originDir, $targetDir); 225 225 } … … 264 264 public function sh($cmd) 265 265 { 266 $this->log ('exec ', $cmd);266 $this->logSection('exec ', $cmd); 267 267 268 268 ob_start(); … … 302 302 } 303 303 304 $this->log ('tokens', $file);304 $this->logSection('tokens', $file); 305 305 306 306 file_put_contents($file, $content); … … 309 309 310 310 /** 311 * Logs a message .311 * Logs a message in a section. 312 312 * 313 313 * @param string The section name … … 315 315 * @param integer The maximum size of a line 316 316 */ 317 protected function log ($section, $text, $size = null)317 protected function logSection($section, $message, $size = null) 318 318 { 319 319 if (!$this->dispatcher) … … 322 322 } 323 323 324 $message = $this->formatter ? $this->formatter->formatSection($section, $ text, $size) : $section.' '.$text."\n";324 $message = $this->formatter ? $this->formatter->formatSection($section, $message, $size) : $section.' '.$message."\n"; 325 325 326 326 $this->dispatcher->notify(new sfEvent($this, 'command.log', array($message))); branches/1.1/lib/task/sfTask.class.php
r6931 r7397 276 276 277 277 /** 278 * Logs a message. 279 * 280 * @param mixed The message as an array of lines of a single string 281 */ 282 protected function log($messages) 283 { 284 if (!is_array($messages)) 285 { 286 $messages = array($messages); 287 } 288 289 $this->dispatcher->notify(new sfEvent($this, 'command.log', $messages)); 290 } 291 292 /** 293 * Logs a message in a section. 294 * 295 * @param string The section name 296 * @param string The message 297 * @param integer The maximum size of a line 298 */ 299 protected function logSection($section, $message, $size = null) 300 { 301 $this->dispatcher->notify(new sfEvent($this, 'command.log', array($this->formatter->formatSection($section, $message, $size)))); 302 } 303 304 /** 278 305 * Executes the current task. 279 306 *