定制 specbee/drupal-recommended-starterkit 二次开发

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

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

specbee/drupal-recommended-starterkit

最新稳定版本:2.1.0

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.

统计信息

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

GitHub 信息

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

其他信息

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