Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use PROJECT_ROOT environment for development project dependencies
- Loading branch information
1 parent
fab3da3
commit 26cf467
Showing
8 changed files
with
59 additions
and
6 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
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
3 changes: 2 additions & 1 deletion
3
src/Administration/Resources/nuxt-component-library/nuxt.config.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php declare(strict_types=1); | ||
|
||
function getProjectDir(): string | ||
{ | ||
$r = new \ReflectionClass($_SERVER['KERNEL_CLASS']); | ||
$dir = $rootDir = \dirname($r->getFileName()); | ||
while (!file_exists($dir . '/composer.json')) { | ||
if ($dir === \dirname($dir)) { | ||
return $rootDir; | ||
} | ||
$dir = \dirname($dir); | ||
} | ||
|
||
return $dir; | ||
} | ||
|
||
$projectDir = getProjectDir(); | ||
|
||
require_once $projectDir . '/vendor/autoload.php'; | ||
|
||
use Symfony\Component\Dotenv\Dotenv; | ||
|
||
if (!class_exists(Dotenv::class)) { | ||
throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.'); | ||
} | ||
(new Dotenv())->load($projectDir . '/.env'); | ||
|
||
putenv('DATABASE_URL=' . getenv('DATABASE_URL') . '_test'); |