grimzy / laravel-mysql-spatial

MySQL Spatial Data Extension integration with Laravel.
Other
796 stars 315 forks source link

Attempts to connect to database on composer install #147

Open martsie opened 4 years ago

martsie commented 4 years ago

I recently added this package, works great, but in our CI when we do a composer install it attempts to connect to the database and fails the composer install. Our CI doesn't really need database access to run unit tests - is there a way to install the package without accessing the database?

sebastianmacarescu commented 4 years ago

I have exactly the same issue and is very frustrating. Just invoking php artisan will fail. Any way to disable this?

sebastianmacarescu commented 4 years ago

Seems like it's from MysqlConnection.php, lines 29-32.

Can we move that somewhere else?

johnwc commented 3 years ago

I came to create the same issue, our unit tests are failing because it tries to retrieve the database platform in the constructor. I don't think it's a good idea to attempt a connection every time the class is created. Seems like a lot of potential undesired DB connections without the user even call a db statement.

sebastianmacarescu commented 3 years ago

Any news on this?

vila3 commented 3 years ago

I'm also facing the same issue, trying to run composer install on a CI/CD pipeline.

Any news on this? Or at least a workaround?

acidjazz commented 3 years ago

I added a hack fork with a fix for my vapor setup here:

https://github.com/guzzlapp/laravel-mysql-spatial/blob/master/src/MysqlConnection.php#L16

This is in no way a proper solution but I'm able to deploy again