forked from wallabag/wallabag
Compare commits
3 Commits
2.6.7_all_
...
fix-instal
| Author | SHA1 | Date | |
|---|---|---|---|
| 357ce8f7c3 | |||
| e185e03c6e | |||
| 2c688daf2a |
55
.github/workflows/continuous-integration.yml
vendored
55
.github/workflows/continuous-integration.yml
vendored
@ -151,3 +151,58 @@ jobs:
|
|||||||
|
|
||||||
- name: "Run PHPUnit"
|
- name: "Run PHPUnit"
|
||||||
run: "php bin/simple-phpunit -v"
|
run: "php bin/simple-phpunit -v"
|
||||||
|
|
||||||
|
phpunit_no_database:
|
||||||
|
name: "PHP ${{ matrix.php }} using ${{ matrix.database }} without DB created"
|
||||||
|
runs-on: "ubuntu-20.04"
|
||||||
|
services:
|
||||||
|
rabbitmq:
|
||||||
|
image: rabbitmq:3-alpine
|
||||||
|
ports:
|
||||||
|
- 5672:5672
|
||||||
|
redis:
|
||||||
|
image: redis:6-alpine
|
||||||
|
ports:
|
||||||
|
- 6379:6379
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: true
|
||||||
|
matrix:
|
||||||
|
php:
|
||||||
|
- "8.2"
|
||||||
|
database:
|
||||||
|
- "mysql"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: "Checkout"
|
||||||
|
uses: "actions/checkout@v3"
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
|
||||||
|
- name: "Install PHP"
|
||||||
|
uses: "shivammathur/setup-php@v2"
|
||||||
|
with:
|
||||||
|
php-version: "${{ matrix.php }}"
|
||||||
|
coverage: none
|
||||||
|
tools: pecl
|
||||||
|
extensions: json, pdo, pdo_mysql, pdo_sqlite, pdo_pgsql, curl, imagick, pgsql, gd, tidy
|
||||||
|
ini-values: "date.timezone=Europe/Paris"
|
||||||
|
|
||||||
|
- name: "Setup MySQL"
|
||||||
|
if: "${{ matrix.database == 'mysql' }}"
|
||||||
|
run: |
|
||||||
|
sudo systemctl start mysql.service
|
||||||
|
|
||||||
|
- name: "Install dependencies with Composer"
|
||||||
|
uses: "ramsey/composer-install@v2"
|
||||||
|
with:
|
||||||
|
composer-options: "--optimize-autoloader --prefer-dist"
|
||||||
|
|
||||||
|
- name: "Install wallabag"
|
||||||
|
run: "php bin/console wallabag:install --env=test"
|
||||||
|
|
||||||
|
- name: "Prepare fixtures"
|
||||||
|
run: "make fixtures"
|
||||||
|
|
||||||
|
- name: "Run PHPUnit"
|
||||||
|
run: "php bin/simple-phpunit -v"
|
||||||
|
|||||||
@ -372,24 +372,25 @@ class InstallCommand extends Command
|
|||||||
private function isDatabasePresent()
|
private function isDatabasePresent()
|
||||||
{
|
{
|
||||||
$connection = $this->entityManager->getConnection();
|
$connection = $this->entityManager->getConnection();
|
||||||
$databaseName = $connection->getDatabase();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$schemaManager = $connection->getSchemaManager();
|
$databaseName = $connection->getDatabase();
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
// mysql & sqlite
|
// mysql & sqlite
|
||||||
if (false !== strpos($exception->getMessage(), sprintf("Unknown database '%s'", $databaseName))) {
|
if (false !== strpos($exception->getMessage(), 'Unknown database')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// pgsql
|
// pgsql
|
||||||
if (false !== strpos($exception->getMessage(), sprintf('database "%s" does not exist', $databaseName))) {
|
if (false !== strpos($exception->getMessage(), 'does not exist')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw $exception;
|
throw $exception;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$schemaManager = $connection->getSchemaManager();
|
||||||
|
|
||||||
// custom verification for sqlite, since `getListDatabasesSQL` doesn't work for sqlite
|
// custom verification for sqlite, since `getListDatabasesSQL` doesn't work for sqlite
|
||||||
if ('sqlite' === $schemaManager->getDatabasePlatform()->getName()) {
|
if ('sqlite' === $schemaManager->getDatabasePlatform()->getName()) {
|
||||||
$params = $connection->getParams();
|
$params = $connection->getParams();
|
||||||
|
|||||||
Reference in New Issue
Block a user