Skip to content

Commit

Permalink
ignore development files on production env
Browse files Browse the repository at this point in the history
Signed-off-by: MarioRadu <[email protected]>
  • Loading branch information
MarioRadu committed Dec 12, 2024
1 parent f55d182 commit fbfae3c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ jobs:
COMPOSER_DEV_MODE=1
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

# - name: Setup project
# run: |
# mv config/autoload/local.test.php.dist config/autoload/local.test.php

- name: Collect code coverage with PHPUnit
run: vendor/bin/phpunit --colors=always --coverage-clover clover.xml

Expand Down
5 changes: 2 additions & 3 deletions bin/composer-post-install-script.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function copyFile(array $file): void

function getEnvironment(): string
{
return file_exists(\Laminas\DevelopmentMode\Status::DEVEL_CONFIG) ? ENVIRONMENT_DEVELOPMENT : ENVIRONMENT_PRODUCTION;
return getenv('COMPOSER_DEV_MODE') === '1' ? ENVIRONMENT_DEVELOPMENT : ENVIRONMENT_PRODUCTION;
}

// when adding files to the below array the `source` and `destination` paths must be relative to the project root folder
Expand All @@ -52,7 +52,6 @@ function getEnvironment(): string
];

echo "Using environment setting: " . getEnvironment() . PHP_EOL;

var_dump(getenv('COMPOSER_DEV_MODE'));
var_dump("getenv('COMPOSER_DEV_MODE')", getenv('COMPOSER_DEV_MODE'));

array_walk($files, 'copyFile');

0 comments on commit fbfae3c

Please sign in to comment.