Download the PHP package jsor/doctrine-postgis without Composer

On this page you can find all versions of the php package jsor/doctrine-postgis. 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 doctrine-postgis

PostGIS extension for Doctrine

Build Status Coverage Status

This library allows you to use Doctrine (ORM or DBAL) with PostGIS, the spatial database extension for PostgreSQL.

Supported Versions

The following table shows the versions which are officially supported by this library.

Dependency Supported Versions
PostGIS 3.0 and 3.1
PostgreSQL 11, 12 and 13
Doctrine ORM ^2.9
Doctrine DBAL ^2.13 and ^3.1

Installation

Install the latest version with Composer.

Check the Packagist page for all available versions.

Setup

To use the library with the Doctrine ORM, register the ORMSchemaEventSubscriber event subscriber.

To use it with the DBAL only, register the DBALSchemaEventSubscriber event subscriber.

Symfony

For integrating this library into a Symfony project, read the dedicated Symfony Documentation.

Property Mapping

Once the event subscriber is registered, the column types geometry and geography can be used in property mappings (please read the PostGIS docs to understand the difference between these two types).

There are 2 options to configure the geometry.

Example

Values provided for the properties must be in the WKT format. Please note, that the values returned from database may differ from the values you have set. The library uses ST_AsEWKT to retain as much information as possible (like SRID's). Read more in the PostGIS docs.

Example

Spatial Indexes

Spatial indexes can be defined for geometry fields by setting the spatial flag.

Schema Tool

Full support for the ORM Schema Tool and the DBAL Schema Manager is provided.

DQL Functions

Most PostGIS functions are also available for the Doctrine Query Language (DQL) under the Jsor\Doctrine\PostGIS\Functions namespace.

For a full list of all supported functions, see the Function Index.

Read the dedicated Symfony documentation on how to configure the functions with Symfony.

The functions must be registered with the Doctrine\ORM\Configuration instance.

There's a convenience Configurator class which can be used to register all functions at once.

Known Problems

Read the dedicated Symfony documentation on how to handle those problems with Symfony.

PostGIS Schema Exclusion

Since PostGIS can add a few new schemas, like topology, tiger and tiger_data, you might want to exclude them from being handled by Doctrine.

This can be done by configuring a schema assets filter.

Unknown Database Types

Sometimes, the schema tool stumbles upon database types it can't handle. A common exception is something like

To solve this, the unknown database types can be mapped to known types.

Note: This type is then not suited to be used in entity mappings. It just prevents "Unknown database type..." exceptions thrown during database inspections by the schema tool.

If you want to use this type in your entities, you have to configure real database types, e.g. with the PostgreSQL for Doctrine package.

Running the Tests

A simple Docker setup is included to run the test suite against the different PostgreSQL / PostGIS combinations.

All commands here should be run from the project root.

First, build the PHP container. This must be done only once.

Install dependencies via Composer.

Next, start the database containers.

There are a number of shortcut scripts available to execute commands inside the PHP container connected to specific database containers.

The script names follow the pattern run-<POSTGRESQL_VERSION>-<POSTGIS_VERSION>.sh.

To run the test suite against PostgreSQL 13 with PostGIS 3.1, use the script ./docker/run-13-31.sh.

Note, that we exclude tests targeted at PostGIS 3.0 here. When running tests against PostGIS 3.0, exclude the tests for 3.1.

License

Copyright (c) 2014-2024 Jan Sorgalla. Released under the MIT License.


All versions of doctrine-postgis with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
doctrine/dbal Version ^2.13 || ^3.1
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 jsor/doctrine-postgis contains the following files

Loading the files please wait ....