Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
composer.lock
boxfile.yml
build/
tests/_?db-*/
35 changes: 35 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
build:
nodes:
analysis:
project_setup:
override:
- 'true'
tests:
override:
- php-scrutinizer-run
- command: phpcs-run
use_website_config: false

tests:
environment:
docker: true
php:
version: 7.2
dependencies:
before:
- sudo service mysql stop
- sudo service postgresql stop
- make -C tests/ start_db_mysql start_db_postgres oV=8.0 pV=11
tests:
override:
- command: ./vendor/bin/phpunit --coverage-clover=my-coverage-file
coverage:
file: my-coverage-file
format: php-clover

checks:
php: true

filter:
excluded_paths:
- tests/*
67 changes: 67 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
language: php

sudo: required

services:
- docker

php:
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- hhvm
- nightly

env:
- MYSQL_VERSION=5.7 PG_VERSION=9.1
- MYSQL_VERSION=8.0 PG_VERSION=9.2
- MARIA_VERSION=5.5 PG_VERSION=9.3
- MARIA_VERSION=10.0 PG_VERSION=9.4
- MARIA_VERSION=10.1 PG_VERSION=9.5
- MARIA_VERSION=10.2 PG_VERSION=9.6
- MARIA_VERSION=10.3 PG_VERSION=10
- MARIA_VERSION=10.4 PG_VERSION=11

matrix:
allow_failures:
- php: '5.6'
- php: hhvm
- php: nightly

before_install:
- sudo /etc/init.d/mysql stop
- |
if [ -n "${MYSQL_VERSION}" ]
then
make -C tests/ start_db_mysql oV=${MYSQL_VERSION}
else
make -C tests/ start_db_maria mV=${MARIA_VERSION}
fi
- sudo /etc/init.d/postgresql stop
- make -C tests/ start_db_postgres pV=${PG_VERSION}

install:
- travis_retry composer install

before_script:
- mkdir -p build/logs
- echo -n Ensuring MySQL/MariaDB is ready; ./tests/wait_container spatial-mysql ; echo
- echo -n Ensuring PostgreSQL DB is ready; ./tests/wait_container spatial-postgres ; echo

script:
- vendor/bin/phpunit --coverage-clover build/logs/clover.xml

after_script:
- |
if [ -n "${MYSQL_VERSION}" ]
then
make -C tests/ rm_db_mysql oV=${MYSQL_VERSION}
else
make -C tests/ rm_db_maria mV=${MARIA_VERSION}
fi
- make -C tests/ rm_db_postgres pV=${PG_VERSION}

after_success:
- bash <(curl -s https://codecov.io/bash)
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Laravel Spatial extension

This package is fully untested, undocumented and unstable and is a combination of the two great packages:
[![](https://img.shields.io/packagist/l/apptimists/laravel-spatial.svg?style=flat-square)](https://packagist.org/packages/apptimists/laravel-spatial)
[![](https://img.shields.io/packagist/php-v/apptimists/laravel-spatial.svg?style=flat-square)](https://packagist.org/packages/apptimists/laravel-spatial)
[![](https://img.shields.io/packagist/v/apptimists/laravel-spatial.svg?style=flat-square)](https://packagist.org/packages/apptimists/laravel-spatial)
[![](https://img.shields.io/packagist/dt/apptimists/laravel-spatial.svg?style=flat-square)](https://packagist.org/packages/apptimists/laravel-spatial)

[![](https://img.shields.io/travis/apptimists/laravel-spatial.svg?style=flat-square)](https://github.com/apptimists/laravel-spatial)
[![](https://img.shields.io/codecov/c/github/apptimists/laravel-spatial.svg?style=flat-square)](https://codecov.io/gh/apptimists/laravel-spatial)
[![](https://img.shields.io/scrutinizer/g/apptimists/laravel-spatial.svg?style=flat-square)](https://scrutinizer-ci.com/g/apptimists/laravel-spatial/)

This package is fully undocumented and unstable, and is a combination of the two great packages:
- [Laravel PostGIS extension](https://github.com/njbarrett/laravel-postgis)
- [Laravel MySQL spatial extension](https://github.com/grimzy/laravel-mysql-spatial)

Expand All @@ -24,13 +33,13 @@ If you try using it on a shared host which is not fulfilling those requirements,
We use the [GeoJson PHP Library](http://jmikola.github.io/geojson/) for describing spatial fields as GeoJSON object, e.g.:
```
use GeoJSON\Geometry\Point;

...

$eloquent = new MyModel();
$eloquent->location = new Point([49.7, 6.9]);

...

$eloquent->save();
```
13 changes: 11 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@
],
"require": {
"php": ">=5.6.4",
"doctrine/dbal": "^2.5",
"funiq/geophp": "dev-master",
"illuminate/database": "^5.3",
"jmikola/geojson": "^1.0",
"phayes/geophp": "^1.2"
"jmikola/geojson": "^1.0"
},
"require-dev": {
"laravel/browser-kit-testing": "^2.0",
"laravel/laravel": "^5.3",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.0"
},
Expand All @@ -24,6 +27,12 @@
"LaravelSpatial\\": "src/"
}
},
"autoload-dev": {
"classmap": [
"tests/Unit",
"tests/Integration"
]
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
Expand Down
Loading