Skip to content

Commit e2d7f50

Browse files
committed
ignore development files on production env
Signed-off-by: MarioRadu <magda_marior@yahoo.com>
1 parent 385b746 commit e2d7f50

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

.github/workflows/codecov.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ jobs:
4444
- name: Install dependencies with composer
4545
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
4646

47+
# - name: Setup project
48+
# run: |
49+
# mv config/autoload/local.test.php.dist config/autoload/local.test.php
50+
4751
- name: Collect code coverage with PHPUnit
4852
run: vendor/bin/phpunit --colors=always --coverage-clover clover.xml
4953

bin/composer-post-install-script.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,7 @@ function copyFile(array $file): void
2626

2727
function getEnvironment(): string
2828
{
29-
$composerInstalledJson = 'vendor/composer/installed.json';
30-
if (! file_exists($composerInstalledJson)) {
31-
throw new RuntimeException('Composer installed JSON file not found.');
32-
}
33-
34-
$data = json_decode(file_get_contents($composerInstalledJson), true);
35-
foreach ($data as $package) {
36-
if (! empty($package['dev'])) {
37-
return ENVIRONMENT_DEVELOPMENT;
38-
}
39-
}
40-
41-
return ENVIRONMENT_PRODUCTION;
29+
return file_exists('config/development.config.php') ? ENVIRONMENT_DEVELOPMENT : ENVIRONMENT_PRODUCTION;
4230
}
4331

4432
// when adding files to the below array the `source` and `destination` paths must be relative to the project root folder

0 commit comments

Comments
 (0)