Beispiel #1
0
 /**
  * @param  string                        $path
  * @param  string                        $file
  * @return \WCM\WPStarter\Env\Env|static
  */
 public static function load($path, $file = '.env')
 {
     if (is_null(self::$loaded)) {
         self::wpConstants();
         if (!is_string($file)) {
             $file = '.env';
         }
         $filePath = rtrim(str_replace('\\', '/', $path), '/') . '/' . $file;
         $loader = new Loader($filePath, true);
         $loader->load();
         self::$loaded = new static($loader->allVarNames());
     }
     return self::$loaded;
 }
Beispiel #2
0
 /**
  * @param  string                        $path
  * @param  string                        $file
  * @return \WCM\WPStarter\Env\Env|static
  */
 public static function load($path, $file = '.env')
 {
     if (is_null(self::$loaded)) {
         self::wpConstants();
         if (!is_string($file)) {
             $file = '.env';
         }
         $filePath = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $file;
         $loader = new Loader($filePath, true);
         $loader->load();
         self::$loaded = new static($loader->allVarNames());
     }
     return self::$loaded;
 }