定制 josegarcia/nexus 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

josegarcia/nexus

最新稳定版本:1.0.3

Composer 安装命令:

composer require josegarcia/nexus

包简介

Helps to read and inject all the variables from the .env file into the global variables $_env and $-_server

README 文档

README

  • A utility package designed to read .env files and inject environment variables into your PHP application.

Description

  • Nexus provides an easy and configuration-free method for loading environment variables from a .env file. It’s a lightweight and user-friendly solution to manage environment settings in your application.

Features

  • Load environment variables from a .env file into your application.
  • Access environment variables using getenv(), $_ENV, or $GLOBALS.
  • No configuration required.
  • No dependencies.
  • Lightweight.
  • Easy to use.
  • Works with PHP 7.4 and above.
  • Works with any PHP framework, library, or application.

Installation

composer require josegarcia/nexus

Usage

use Garcia\Nexus;

$filePath = __DIR__ . '/.env.test'; // Assuming .env is present for testing purposes

// Create a temporary .env file for testing
file_put_contents($filePath, "TEST_VAR=123\nANOTHER_VAR=abc");

// Load the .env file
Nexus::load($filePath);

// Check if environment variables are set
echo getenv('TEST_VAR') . "\n";
echo $_ENV['ANOTHER_VAR'] . "\n";
echo $GLOBALS['TEST_VAR'] . "\n";
echo getenv('ANOTHER_VAR') . "\n";

统计信息

  • 总下载量: 69
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固