Skip to content

Commit 64d5e82

Browse files
committed
ignore development files on production env
Signed-off-by: MarioRadu <magda_marior@yahoo.com>
1 parent 84043db commit 64d5e82

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bin/composer-post-install-script.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
declare(strict_types=1);
44

5+
require_once 'vendor/autoload.php';
6+
57
const ENVIRONMENT_DEVELOPMENT = 'development';
68
const ENVIRONMENT_PRODUCTION = 'production';
79

@@ -26,7 +28,7 @@ function copyFile(array $file): void
2628

2729
function getEnvironment(): string
2830
{
29-
return file_exists(realpath(__DIR__ . '/../config/development.config.php')) ? ENVIRONMENT_DEVELOPMENT : ENVIRONMENT_PRODUCTION;
31+
return file_exists(\Laminas\DevelopmentMode\Status::DEVEL_CONFIG) ? ENVIRONMENT_DEVELOPMENT : ENVIRONMENT_PRODUCTION;
3032
}
3133

3234
// when adding files to the below array the `source` and `destination` paths must be relative to the project root folder
@@ -51,6 +53,6 @@ function getEnvironment(): string
5153

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

54-
var_dump("File exists " , file_exists(realpath(__DIR__ . '/../config/development.config.php')));
56+
var_dump(file_exists(\Laminas\DevelopmentMode\Status::DEVEL_CONFIG));
5557

5658
array_walk($files, 'copyFile');

0 commit comments

Comments
 (0)