PHP Class Ipalaus\Geonames\Commands\ImportCommand

Inheritance: extends Illuminate\Console\Command
Afficher le fichier Open project: ipalaus/geonames

Protected Properties

Свойство Type Description
$archive ZipArchive File archive instance.
$config array Configuration options.
$description string The console command description.
$filesystem Illuminate\Filesystem\Filesystem Filesystem implementation.
$importer Ipalaus\Geonames\Importer Importer instance.
$name string The console command name.

Méthodes publiques

Méthode Description
__construct ( Ipalaus\Geonames\Importer $importer, Illuminate\Filesystem\Filesystem $filesystem, array $config ) : void Create a new console command instance.
fire ( ) : void Execute the console command.
getFiles ( ) : array Get the files to download.
runProcess ( Process $process ) : Process Run a given process.

Méthodes protégées

Méthode Description
downloadFile ( string $url, string $path, $filename ) : void Download a file from a remote URL to a given path.
extractZip ( string $path, string $filename ) : string Given a zip archive, extract a the file and remove the original.
fileExists ( string $path, string $filename ) : boolean Checks if a file already exists on a path. If the file contains .zip in the name we will also check for matches with .txt.
getOptions ( ) : array Get the console command options.
getPath ( ) : string Return the working path.
makeProcess ( string $command ) : Process Create a process with the given command.
seedCommand ( string $class, $extra = '' ) : void Run a seed coman in a separate process.
setCountry ( string $country ) : void Sets the name file to a specific country.
setDevelopment ( ) : void Sets the names file for a ligher version for development. We also ignore the alternate names.

Method Details

__construct() public méthode

Create a new console command instance.
public __construct ( Ipalaus\Geonames\Importer $importer, Illuminate\Filesystem\Filesystem $filesystem, array $config ) : void
$importer Ipalaus\Geonames\Importer
$filesystem Illuminate\Filesystem\Filesystem
$config array
Résultat void

downloadFile() protected méthode

Download a file from a remote URL to a given path.
protected downloadFile ( string $url, string $path, $filename ) : void
$url string
$path string
Résultat void

extractZip() protected méthode

Given a zip archive, extract a the file and remove the original.
protected extractZip ( string $path, string $filename ) : string
$path string
$filename string
Résultat string

fileExists() protected méthode

Checks if a file already exists on a path. If the file contains .zip in the name we will also check for matches with .txt.
protected fileExists ( string $path, string $filename ) : boolean
$path string
$filename string
Résultat boolean

fire() public méthode

Execute the console command.
public fire ( ) : void
Résultat void

getFiles() public méthode

Get the files to download.
public getFiles ( ) : array
Résultat array

getOptions() protected méthode

Get the console command options.
protected getOptions ( ) : array
Résultat array

getPath() protected méthode

Return the working path.
protected getPath ( ) : string
Résultat string

makeProcess() protected méthode

Create a process with the given command.
protected makeProcess ( string $command ) : Process
$command string
Résultat Symfony\Component\Process\Process

runProcess() public méthode

Run a given process.
public runProcess ( Process $process ) : Process
$process Symfony\Component\Process\Process
Résultat Symfony\Component\Process\Process

seedCommand() protected méthode

Run a seed coman in a separate process.
protected seedCommand ( string $class, $extra = '' ) : void
$class string
Résultat void

setCountry() protected méthode

Sets the name file to a specific country.
protected setCountry ( string $country ) : void
$country string
Résultat void

setDevelopment() protected méthode

Sets the names file for a ligher version for development. We also ignore the alternate names.
protected setDevelopment ( ) : void
Résultat void

Property Details

$archive protected_oe property

File archive instance.
protected ZipArchive $archive
Résultat ZipArchive

$config protected_oe property

Configuration options.
protected array $config
Résultat array

$description protected_oe property

The console command description.
protected string $description
Résultat string

$filesystem protected_oe property

Filesystem implementation.
protected Filesystem,Illuminate\Filesystem $filesystem
Résultat Illuminate\Filesystem\Filesystem

$importer protected_oe property

Importer instance.
protected Importer,Ipalaus\Geonames $importer
Résultat Ipalaus\Geonames\Importer

$name protected_oe property

The console command name.
protected string $name
Résultat string