Ejemplo n.º 1
0
        while ($zip_location->valid()) {
            $decode = explode('|', $zip_location->current());
            $num = $this->countRestaurantsForlocation($decode[1], $decode[2]);
            echo " para el codigo postal {$decode[0]}  hay  {$num}  restaurantses \n";
            fwrite($handle, "{$decode[0]}|{$num}\n");
            $zip_location->next();
        }
        fclose($handle);
        echo " Ha terminado el proceso sobre el archivo {$txt}\n";
    }
}
switch ($argv[1]) {
    case '--by-block':
        $zipcode = new Zipcode();
        $zipcode->zipcodesUniqueValues('');
        $zipcode->mintcraftLocation();
        break;
    case '--location':
        $zipcode = new Zipcode();
        $zipcode->readzipFile();
        $zipcode->createFileZipLocation();
        break;
    case '--restaurant-num-by-location':
        $zipcode = new Zipcode();
        $zipcode->mintcraftZip();
        break;
    case '--all':
        $zipcode = new Zipcode();
        $zipcode->readzipFile();
        $zipcode->createFileZipLocation();
        $zipcode->mintcraftZip();