Download the PHP package ipalaus/geonames without Composer

On this page you can find all versions of the php package ipalaus/geonames. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package geonames

THIS PACKAGE IS ABANDONED. PLEASE, USE AN ALTERNATIVE.

Eloquent Geonames

Build Status Coverage Status

A collection of Eloquent models and Commands to get all the power of GeoNames in Laravel.

Installation

Add ipalaus/geonames as a requirement to composer.json:

Note: if you're using Laravel 5.1 you can use the version "ipalaus/geonames": "2.0.*".

Update your packages with composer update or install with composer install.

Once you have installed the dependency, you need to register geonames in Laravel. Open your app/config/app.php and add the next provider to your providers array:

If you run now php artisan you should see a new namespace geonames with a few commands related to the package. In order to proceed with the install, run the next command:

This will publish the config file to config/geonames.php and the migrations to your database/migrations directory. To be able to control what's going on, we recommend you to manually trigger php artisan migrate.

Artisan Commands

Import

The import command downloads the needed files (configurable in the config file) and run a seeder for each of them. A few options are provided:

Importing a production database can take a while. Main file is ~1GB and the seeder has to insert ~6M rows while creating indexes for some fields. In development environments, I highly recommend to use the --development option and keep complete imports to production. The final table sizes can also affect your local MySQL instance.

Install

Publish the package's config and run the needed migrations. You can force the config publishing with the --force option.

Seed

The is called by the geonames:import command. It extends the Laravel's db:seed but add to extra options: path and country. This is due to the size of the files to import and the queries that we have to run, geonames:import creates a new Symfony\Component\Process\Process for each seeder.

You shouldn't need to call this command directly.

Truncate

Do you want to truncate the table and start from scratch? Run:

Eloquent Models

Continent

Country

Name

... and more to come up!

Integrating to a current Eloquent model

Integrating ipalaus/geonames with your existing Eloquent models as easy as:

Now you can a geoname_id to your User model and getting the results with a simple:

The belongsTo country relationship in the Name model is always eager loaded. That means that you can get the country name with the same code as above. You just have to echo:

You can go a step further and eager loaded the geoname.country.continent relationship (or whatever existing relation in Geoname models):

GeoNames

Tables reference

I think the original table names are ugly and they can conflict with other tables in a current project. I switched to a less uglier ones. You can check the migration files to see the used names for our database schema.

Original Eloquent Geonames
geoname geonames_names
alternatename geonames_alternate_names
countryinfo geonames_countries
iso_languagecodes geonames_language_codes
admin1CodesAscii geonames_admin_divisions
admin2Codes geonames_admin_subdivisions
hierarchy geonames_hierarchy
featureCodes geonames_features
timeZones geonames_timezones
continentCodes geonames_continents

All versions of geonames with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
ext-zip Version *
illuminate/config Version >=5.1.0
illuminate/console Version >=5.1.0
illuminate/database Version >=5.1.0
illuminate/filesystem Version >=5.1.0
illuminate/support Version >=5.1.0
symfony/process Version 2.8.*|3.0.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ipalaus/geonames contains the following files

Loading the files please wait ....