Dotenv\Loader::load PHP Method

load() public method

Load .env file in given directory.
public load ( ) : array
return array
    public function load()
    {
        $this->ensureFileIsReadable();
        $filePath = $this->filePath;
        $lines = $this->readLinesFromFile($filePath);
        foreach ($lines as $line) {
            if (!$this->isComment($line) && $this->looksLikeSetter($line)) {
                $this->setEnvironmentVariable($line);
            }
        }
        return $lines;
    }

Usage Example

Example #1
0
 /**
  * Load `.env` file in given directory.
  *
  * @return array
  */
 public function overload()
 {
     $this->loader = new Loader($this->filePath, $immutable = false);
     return $this->loader->load();
 }
All Usage Examples Of Dotenv\Loader::load