Elcodi\Common\CommonBundle\Command\ElcodiInstallCommand::loadLocation PHP Метод

loadLocation() приватный Метод

Load country from Elcodi files Repository
private loadLocation ( Symfony\Component\Console\Output\OutputInterface $output, string $country )
$output Symfony\Component\Console\Output\OutputInterface Output
$country string Country name
    private function loadLocation(OutputInterface $output, $country)
    {
        try {
            $url = "https://raw.githubusercontent.com/elcodi/LocationDumps/master/" . $country . ".sql";
            $content = file_get_contents($url);
            if ($content) {
                $stmt = $this->locationEntityManager->getConnection()->prepare($content);
                $stmt->execute();
                $this->printMessage($output, 'Elcodi', 'Country ' . $country . ' installed');
            }
        } catch (Exception $e) {
            $this->printMessageFail($output, 'Elcodi', 'Country ' . $country . ' not installed');
        }
        return $this;
    }