forked from smindel/silverstripe-sqlite3
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from open-sausages/pulls/4.0/update-styles
Update config / code styles for 4.0
- Loading branch information
Showing
9 changed files
with
175 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,40 @@ | ||
language: php | ||
|
||
dist: precise | ||
dist: trusty | ||
|
||
sudo: false | ||
cache: | ||
directories: | ||
- $HOME/.composer/cache/files | ||
|
||
php: | ||
- 5.6 | ||
- 7.0 | ||
- 7.1 | ||
|
||
env: | ||
- DB=SQLITE CORE_RELEASE=4 PDO=1 | ||
global: | ||
- DB=SQLITE | ||
- PDO=1 | ||
|
||
matrix: | ||
fast_finish: true | ||
include: | ||
- php: 5.6 | ||
env: DB=SQLITE CORE_RELEASE=4 PDO=0 | ||
env: PDO=0 PHPCS_TEST=1 | ||
|
||
before_script: | ||
# Init PHP | ||
- printf "\n" | pecl install imagick | ||
- phpenv rehash | ||
- phpenv config-rm xdebug.ini | ||
- export PATH=~/.composer/vendor/bin:$PATH | ||
- echo 'memory_limit = 2048M' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini | ||
|
||
# Install composer dependencies | ||
- composer validate | ||
- composer require symfony/config:^3.2 silverstripe/framework:4.0.x-dev silverstripe/cms:4.0.x-dev silverstripe/siteconfig:4.0.x-dev silverstripe/config:1.0.x-dev silverstripe/admin:1.0.x-dev silverstripe/assets:1.0.x-dev silverstripe/versioned:1.0.x-dev --no-update | ||
- composer require --no-update silverstripe/recipe-cms:1.0.x-dev | ||
- composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile | ||
- if [[ $PHPCS_TEST ]]; then composer global require squizlabs/php_codesniffer:^3 --prefer-dist --no-interaction --no-progress --no-suggest -o; fi | ||
|
||
script: | ||
- vendor/bin/phpunit vendor/silverstripe/framework/tests | ||
- if [[ $PHPCS_TEST ]]; then composer run-script lint; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
<?php | ||
|
||
// Script called from ConfigureFromEnv.php | ||
global $databaseConfig; | ||
if(strpos($databaseConfig['type'], 'SQLite') === 0) { | ||
// Called from DatabaseAdapterRegistry::autoconfigure($config) | ||
use SilverStripe\Core\Environment; | ||
use SilverStripe\SQLite\SQLite3Database; | ||
|
||
if(defined('SS_SQLITE_DATABASE_PATH')) { | ||
$databaseConfig['path'] = SS_SQLITE_DATABASE_PATH; | ||
} | ||
if (!isset($databaseConfig)) { | ||
global $databaseConfig; | ||
} | ||
|
||
// Get path | ||
$path = Environment::getEnv(SQLite3Database::ENV_PATH); | ||
if ($path) { | ||
$databaseConfig['path'] = $path; | ||
} elseif (defined(SQLite3Database::ENV_PATH)) { | ||
$databaseConfig['path'] = constant(SQLite3Database::ENV_PATH); | ||
} | ||
|
||
if(defined('SS_SQLITE_DATABASE_KEY')) { | ||
$databaseConfig['key'] = SS_SQLITE_DATABASE_KEY; | ||
} | ||
// Get key | ||
$key = Environment::getEnv(SQLite3Database::ENV_KEY); | ||
if ($key) { | ||
$databaseConfig['key'] = $key; | ||
} elseif (defined(SQLite3Database::ENV_KEY)) { | ||
$databaseConfig['key'] = constant(SQLite3Database::ENV_KEY); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.