update v1.0.6

This commit is contained in:
sujitprasad
2016-02-16 22:42:08 +05:30
parent e6b579d67b
commit 073a49a8af
587 changed files with 21487 additions and 22766 deletions

View File

@@ -5,7 +5,6 @@ namespace libphonenumber\buildtools\Commands;
use libphonenumber\buildtools\GeneratePhonePrefixData;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\ProgressHelper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
@@ -26,14 +25,11 @@ class GeneratePhonePrefixDataCommand extends Command
protected function execute(InputInterface $input, OutputInterface $output)
{
/** @var ProgressHelper $progress */
$progress = $this->getHelperSet()->get('progress');
$generatePhonePrefixData = new GeneratePhonePrefixData();
$generatePhonePrefixData->start(
$input->getArgument('InputDirectory'),
$input->getArgument('OutputDirectory'),
$output,
$progress
$output
);
}
}

View File

@@ -2,7 +2,7 @@
namespace libphonenumber\buildtools;
use Symfony\Component\Console\Helper\ProgressHelper;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Output\OutputInterface;
class GeneratePhonePrefixData
@@ -22,21 +22,19 @@ EOT;
private $filesToIgnore = array('.', '..', '.svn', '.git');
private $outputDir;
private $englishMaps = array();
/**
* @var OutputInterface
*/
private static $consoleOutput;
public function start($inputDir, $outputDir, OutputInterface $consoleOutput, ProgressHelper $progress)
public function start($inputDir, $outputDir, OutputInterface $consoleOutput)
{
$this->inputDir = $inputDir;
$this->outputDir = $outputDir;
self::$consoleOutput = $consoleOutput;
$inputOutputMappings = $this->createInputOutputMappings();
$availableDataFiles = array();
$progress->start($consoleOutput, count($inputOutputMappings));
$progress = new ProgressBar($consoleOutput, count($inputOutputMappings));
$progress->start();
foreach ($inputOutputMappings as $textFile => $outputFiles) {
$mappings = $this->readMappingsFromFile($textFile);