定制 kerasai/lamp-env 二次开发

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

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

kerasai/lamp-env

最新稳定版本:1.0.0-beta1

Composer 安装命令:

composer require kerasai/lamp-env

包简介

Environment detection utility.

README 文档

README

Library for environment detection.

Usage

Add Composer PSR-4 Autoloader

    "autoload": {
        "psr-4": {
            "MyProject\\": "src/"
        }
    }

Create an Env class

Example Lando Env class src/Env/Env.php:

<?php

namespace MyProject\Env;

use kerasai\LampEnv\Env as BaseEnv;
use kerasai\LampEnv\Hosts\GithubActionsEnvTrait;
use kerasai\LampEnv\Hosts\LandoEnvTrait;

/**
 * Detect the environment.
 */
class Env extends BaseEnv {

  use GithubActionsEnvTrait;
  use LandoEnvTrait;

  /**
   * {@inheritdoc}
   */
  protected function detectInfo(): array {
    if ($lando = $this->detectLando()) {
      return $lando;
    }
    return $this->detectGithubActions() ?: parent::detectInfo();
  }

}

Drupal Settings File

<?php

$env = \MyProject\Env\Env::create();

foreach ($env->getIncludes() as $include) {
  $filename = __DIR__ . '/' . $include;
  if (file_exists($filename)) {
    include $filename;
  }
}

// Local settings overrides.
if (file_exists(__DIR__ . '/settings.local.php')) {
  include __DIR__ . '/settings.local.php';
}

Specific settings files

  • settings.default.php: Settings applicable to all environments
  • settings.[mode].php: Settings applicable to a type of environment (dev/test/live)
  • settings.[host].php: Settings applicable to a specific host (Lando, Pantheon, etc.)
  • settings.[host].[mode].php: Settings applicable to a type of environment on a specific host

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2022-01-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固