PHP code example of specbee / drupal-recommended-starterkit

1. Go to this page and download the library: Download specbee/drupal-recommended-starterkit library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

specbee / drupal-recommended-starterkit example snippets



// 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