PHP code example of solumdesignum / package-env-loader

1. Go to this page and download the library: Download solumdesignum/package-env-loader library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

solumdesignum / package-env-loader example snippets




declare(strict_types=1);

use SolumDeSignum\PackageEnvLoader\Contracts\PackageEnvLoaderContract;
use SolumDeSignum\PackageEnvLoader\Traits\PackageEnvLoader;

class ExampleIntegration implements PackageEnvLoaderContract
{
    use PackageEnvLoader;

    /**
     * @var bool 
     */
    private array $packageEnvLoaded;

    /**
     * ExampleIntegration constructor.
     */
    public function __construct()
    {
        $this->packageEnvLoaded = $this->createPackageDotenv(['.env.first.test', '.env.second.test']);
    }

    /**
     * Define the root path for environment files.
     *
     * @param array $paths
     *
     * @return array
     */
    public function packageEnvRootPath(array $paths = [__DIR__ . '/..']): string|array
    {
        return $paths;
    }
}