Skip to content

Commit

Permalink
Readded counters for export and mkdir operations.
Browse files Browse the repository at this point in the history
  • Loading branch information
mermshaus committed Apr 10, 2012
1 parent 2bec1f2 commit d3adfb4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions library/Phpsog/Command/BuildCommand.php
Expand Up @@ -29,6 +29,7 @@ class BuildCommand extends AbstractCommand
public function execute(Application $application)
{
$logger = $application->getLogger();
$dispatcher = $application->getDispatcher();
$argv = $this->argv;

$params = array(
Expand All @@ -42,18 +43,18 @@ public function execute(Application $application)
$adapt = function (ExportEvent $event) use ($logger) {
$logger->onExport($event);
};
$application->getDispatcher()->addListener('onExport', $adapt);
$application->getDispatcher()->addListener('onMkdir', $adapt);
$dispatcher->addListener('onExport', $adapt);
$dispatcher->addListener('onMkdir', $adapt);

/*$exportCounter = 0;
$exportCounter = 0;
$mkdirCounter = 0;

$dispatcher->addListener('onExport', function () use (&$exportCounter) {
$exportCounter++;
});
$dispatcher->addListener('onMkdir', function () use (&$mkdirCounter) {
$mkdirCounter++;
});*/
});

$application->loadConfig($params['config']);

Expand All @@ -62,7 +63,7 @@ public function execute(Application $application)
$application->processHtmlProvider();
$application->processResources();

/*$logger->log("\n" . 'Event count: Export: ' . $exportCounter
. ' Mkdir: ' . $mkdirCounter);*/
$logger->log("\n" . 'Event count: Export: ' . $exportCounter
. ' Mkdir: ' . $mkdirCounter);
}
}

0 comments on commit d3adfb4

Please sign in to comment.