specbee/drupal-recommended-starterkit 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

specbee/drupal-recommended-starterkit

Composer 安装命令:

composer create-project specbee/drupal-recommended-starterkit

包简介

Project template for Drupal projects with a relocated document root

README 文档

README

CI

A Drupal StarterKit Project template based out of Drupal Recommended Project and Drupal Composer Template to create Drupal projects with out-of-box required tools and packages to kickstart a project.

What is included

Installation

Create a new project with Composer create project command from dev version.

composer create-project specbee/drupal-recommended-starterkit:10.x-dev
--no-interaction drupal10
cd drupal10
ddev start

This will install drupal 10.3.0-beta1 For drupal 10.2.6 run the below command:

composer create-project specbee/drupal-recommended-starterkit:1.0.0
--no-interaction drupal10
cd drupal10
ddev start

For drupal 11.0.0-beta1 run the below command:

composer create-project specbee/drupal-recommended-starterkit:2.0.0
--no-interaction drupal11
cd drupal10
ddev start

Please note: You'll need DDEV 1.23.0 or later. See the documentation if you need to upgrade.

You can update the local development configurations for Local Development in the .ddev/config.yml file. For example, to change the project name update the name parameter in the configuration file.

Adding Packages

Use composer require to include and download dependencies for your project.

cd some-dir
composer require drupal/devel

Adding Libraries

You can manage front-end asset libraries with Composer thanks to the asset-packagist repository. Composer will detect and install new versions of a library that meet the stated constraints.

composer require bower-asset/dropzone

Using GrumPHP

The package setups code quality checking tools for Drupal project during git commits.

Forcing commit message format

To configure commit message structure, use the git_commit_message task. For example, to enforce the commit message contains the Jira issue ID, use the rule as the following snippet. More options are documented online.

# grumphp.yml
grumphp:
  tasks:
    git_commit_message:
      matchers:
        "Must follow the pattern":
        '/(^JIRA-[0-9]+(: )[^ ].{5,}\.)|(Merge branch (.)+)/'

Using DotEnv

You can now add environment variables to your .env file and it will automatically be available in the $_ENV global var.

You can use it in settings.php, in service providers or in other places throughout your code. Some examples:

<?php
// phpcs:ignore
// settings.php.
$databases['default']['default'] = [
  'database' => $_ENV['DB_DATABASE'],
  'username' => $_ENV['DB_USERNAME'],
  'password' => $_ENV['DB_PASSWORD'] ?? '',
  'prefix' => '',
  'host' => $_ENV['DB_HOST'] ?? 'localhost',
  'port' => $_ENV['DB_PORT'] ?? 3306,
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',
];

$config['mandrill.settings'] = [
  'mandrill_api_key' => $_ENV['MANDRILL_API_KEY'],
];
// phpcs:ignore
<? php

namespace Drupal\yourmodule;

use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderInterface;

/**
 * Sample class.
 */
class YourmoduleServiceProvider implements ServiceProviderInterface {

  /**
   * Sample method.
   */
  public function register(ContainerBuilder $container) {
    $container->setParameter('yourmodule.some_secret', $_ENV['SOME_SECRET']);
  }

}
php ?>

On live environments, you should invoke drush dotenv:dump every time your .env file changes. If you don't, the .env file will be loaded at every request, which will decrease the performance of your application.

You can use the drush dotenv:dump command to get debugging info about the scanned dotenv files and the loaded variables.

Read the Symfony documentation for more information.

specbee/drupal-recommended-starterkit 适用场景与选型建议

specbee/drupal-recommended-starterkit 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 78 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 05 月 20 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 specbee/drupal-recommended-starterkit 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 specbee/drupal-recommended-starterkit 我们能提供哪些服务?
定制开发 / 二次开发

基于 specbee/drupal-recommended-starterkit 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2024-05-20