Search code examples
githubrepositorycomposer-phplaravel-5.1geonames

Laravel-5.1 geonames, cloning repository using Composer


I want to use geonames for addresses on a website. I'm developing it using Laravel 5.1. I found this useful as a tutorial to get started: Ipalaus Laravel 4.* for Geonames.

Because of its version incompatibility, I contacted a co-worker on the project who redirected me to use his repository: My conversation with Javier Martinz on L-5.1 compatible update. The simple solution was to add his repository which I did in composer.json. After running this I was expecting to have seen the repository cloned and have artisan command for geonames, to my surprise nothing of sort. I am using no version control like git, just storing locally.

How do I clone the repository? I have written him but no response for now. I suppose he's taken a break for the holidays.

This is my composer.json file

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.1.*",
        "laravelcollective/html": "5.1.*",
        "laravel/socialite": "^2.0",
        "toin0u/geocoder-laravel": "@stable",
        "ext-zip": "*",
        "illuminate/config": ">=5.1.0",
        "illuminate/console": ">=5.1.0",
        "illuminate/database": ">=5.1.0",
        "illuminate/filesystem": ">=5.1.0",
        "illuminate/support": ">=5.1.0",
        "symfony/process": "2.7.*",
        "guzzle/http": "^3.9",
        "guzzlehttp/guzzle": "~4.0"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },

    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/JavierMartinz/geonames"
        }
    ],    
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "pre-update-cmd": [
            "php artisan clear-compiled"
        ],
        "post-update-cmd": [
            "php artisan optimize"
        ],
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

This is the error I got when I added: "ipalaus/geonames": "1.0.*"

C:\Users\ken4ward\Documents\xampp\htdocs\tradersmart>composer update
> php artisan clear-compiled
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Removing guzzlehttp/psr7 (1.2.1)
  - Removing psr/http-message (1.0)
  - Removing guzzlehttp/promises (1.0.3)
  - Installing guzzlehttp/streams (2.1.0)
    Downloading: 100%

  - Removing guzzlehttp/guzzle (6.1.1)
  - Installing guzzlehttp/guzzle (4.2.3)
    Downloading: 100%

  - Removing laravel/socialite (v2.0.14)
  - Installing laravel/socialite (v2.0.4)
    Downloading: 100%

Writing lock file
Generating autoload files
> php artisan optimize
Generating optimized class loader

C:\Users\ken4ward\Documents\xampp\htdocs\tradersmart>composer update
> php artisan clear-compiled
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - ipalaus/geonames v1.0.0 requires illuminate/config 4.2.* -> no matching pa
ckage found.
    - ipalaus/geonames v1.0.1 requires illuminate/config 4.2.* -> no matching pa
ckage found.
    - ipalaus/geonames v1.0.2 requires illuminate/config 4.2.* -> no matching pa
ckage found.
    - ipalaus/geonames v1.0.1 requires illuminate/config 4.2.* -> no matching pa
ckage found.
    - ipalaus/geonames v1.0.0 requires illuminate/config 4.2.* -> no matching pa
ckage found.
    - Installation request for ipalaus/geonames 1.0.* -> satisfiable by ipalaus/
geonames[v1.0.0, v1.0.1, v1.0.2].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your min
imum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> f
or more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further commo
n problems.

Solution

  • I tried to use ipalaus/geonames also, and it was not so nice. It did not function and the issue tickets I created months ago got no response. So I made my own package which imports much faster than ipalaus/geonames and more complete already. It took 15 hours to import the databases with ipalaus/geonames and it takes merely 30 minutes with my package.