update v1.0.6
This commit is contained in:
@@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user