src/Geocoder/Provider/GeocoderServiceProvider.php
protected function injectServices(Container $app)
    {
        if (isset($app['profiler'])) {
            $app['geocoder.logger'] = function($app) {
                return new \Geocoder\Logger\GeocoderLogger();
            };

            $app['geocoder'] = function($app) {
                $geocoder = new \Geocoder\LoggableGeocoder();
                $geocoder->setLogger($app['geocoder.logger']);
                $geocoder->registerProvider($app['geocoder.provider']);

                return $geocoder;
            };
        } else {
            $app['geocoder'] = function($app) {
                $geocoder = new \Geocoder\Geocoder();
                $geocoder->registerProvider($app['geocoder.provider']);

                return $geocoder;
            };
        }

        $app['geocoder.provider'] = function($app) {
            return new \Geocoder\Provider\FreeGeoIpProvider($app['geocoder.adapter']);
        };

        $app['geocoder.adapter'] = function($app) {
            return new \Geocoder\HttpAdapter\CurlHttpAdapter();
        };
    }
protected function injectServices(Container $app)
    {
        if (isset($app['profiler'])) {
            $app['geocoder.logger'] = function($app) {
                return new \Geocoder\Logger\GeocoderLogger();
            };

            $app['geocoder'] = function($app) {
                $geocoder = new \Geocoder\LoggableGeocoder();
                $geocoder->setLogger($app['geocoder.logger']);
                $geocoder->registerProvider($app['geocoder.provider']);

                return $geocoder;
            };
        } else {
            $app['geocoder'] = function($app) {
                $geocoder = new \Geocoder\Geocoder();
                $geocoder->registerProvider($app['geocoder.provider']);

                return $geocoder;
            };
        }

        $app['geocoder.provider'] = function($app) {
            return new \Geocoder\Provider\FreeGeoIpProvider($app['geocoder.adapter']);
        };

        $app['geocoder.adapter'] = function($app) {
            return new \Geocoder\HttpAdapter\CurlHttpAdapter();
        };
    }
protected function injectServices ( Container $ app ) { if ( isset ( $ app [ 'profiler' ] ) ) { $ app [ 'geocoder.logger' ] = function ( $ app ) { return new \ Geocoder \ Logger \ GeocoderLogger ( ) ; } ; $ app [ 'geocoder' ] = function ( $ app ) { $ geocoder = new \ Geocoder \ LoggableGeocoder ( ) ; $ geocoder -> setLogger ( $ app [ 'geocoder.logger' ] ) ; $ geocoder -> registerProvider ( $ app [ 'geocoder.provider' ] ) ; return $ geocoder ; } ; } else { $ app [ 'geocoder' ] = function ( $ app ) { $ geocoder = new \ Geocoder \ Geocoder ( ) ; $ geocoder -> registerProvider ( $ app [ 'geocoder.provider' ] ) ; return $ geocoder ; } ; } $ app [ 'geocoder.provider' ] = function ( $ app ) { return new \ Geocoder \ Provider \ FreeGeoIpProvider ( $ app [ 'geocoder.adapter' ] ) ; } ; $ app [ 'geocoder.adapter' ] = function ( $ app ) { return new \ Geocoder \ HttpAdapter \ CurlHttpAdapter ( ) ; } ; }
Injects Geocoder related services in the application.
Injects Geocoder related services in the application .