Skip to content

Commit 27e1c3b

Browse files
author
Gabriel Simmer
committed
Build project via travisci
Only build on master branch. PECL > APT for travisci Don't install PDO automatically Assume travisci has bcmath Download PHPCS instead of composer require. PHPCS via composer...? Require dev drupal sniffer. Fix coding standards issues.
1 parent 78dc180 commit 27e1c3b

File tree

4 files changed

+103
-9
lines changed

4 files changed

+103
-9
lines changed

.travis.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ language: php
22
php:
33
- 7.2
44
install:
5-
- sudo apt install php-bcmath
65
- export PATH="$HOME/.composer/vendor/bin:$PATH"
76
- composer install
8-
- composer global require "squizlabs/php_codesniffer=*"
9-
- composer global require drush/drush:6.*
10-
script: phpcs -n --standard=Drupal src
7+
8+
script : vendor/bin/phpcs -n --standard=vendor/drupal/coder/coder_sniffer/Drupal src
9+
10+
build:
11+
provider: script
12+
script: mkdir build && vendor/bin/phar-builder package composer.json
13+
on:
14+
branch: master

composer.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
}
4343
},
4444
"require-dev": {
45-
"macfja/phar-builder": "dev-master"
45+
"macfja/phar-builder": "dev-master",
46+
"squizlabs/php_codesniffer": "*",
47+
"drupal/coder": "^8.3"
4648
}
4749
}

composer.lock

+89-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DatabaseJanitor.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
require __DIR__ . '/../vendor/autoload.php';
66

7-
use Ifsnop\Mysqldump as IMysqldump;
7+
use Ifsnop\Mysqldump\Mysqldump;
88

99
/**
1010
* Class DatabaseJanitor.
@@ -32,7 +32,7 @@ public function __construct($database, $user, $host, $password, $dumpOptions) {
3232
$this->dumpOptions = $dumpOptions;
3333
try {
3434
$this->connection = new \PDO('mysql:host=' . $this->host . ';dbname=' . $this->database, $this->user, $this->password, array(
35-
\PDO::ATTR_PERSISTENT => true
35+
\PDO::ATTR_PERSISTENT => TRUE
3636
));
3737
}
3838
catch (\Exception $e) {
@@ -63,7 +63,7 @@ public function dump($host = FALSE, $output = FALSE) {
6363
'exclude-tables' => $this->dumpOptions['excluded_tables'] ?? [],
6464
];
6565
try {
66-
$dump = new IMysqldump\Mysqldump('mysql:host=' . $this->host . ';dbname=' . $this->database, $this->user, $this->password, $dumpSettings);
66+
$dump = new Mysqldump('mysql:host=' . $this->host . ';dbname=' . $this->database, $this->user, $this->password, $dumpSettings);
6767
$dump->setTransformColumnValueHook(function ($table_name, $col_name, $col_value) {
6868
return $this->sanitize($table_name, $col_name, $col_value, $this->dumpOptions);
6969
});

0 commit comments

Comments
 (0)