PHP code example of woprrr / drupal8-composer-template

1. Go to this page and download the library: Download woprrr/drupal8-composer-template 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/ */

    

woprrr / drupal8-composer-template example snippets


    # Config directories
    $config_directories = array(
      my_configuration_name => '/absolute/path/to/config'
    );
    

    # Config directories
    $config_directories = array(
      dev => getcwd() . '/../config/dev',
      preprod => getcwd() . '/../config/preprod',
      prod => getcwd() . '/../config/prod',
      stage => getcwd() . '/../config/stage',
    );
    


    try {
        $dsn = 'mysql:host=mysql;dbname=test;charset=utf8;port=3306';
        $pdo = new PDO($dsn, 'dev', 'dev');
    } catch (PDOException $e) {
        echo $e->getMessage();
    }
sh
which docker-compose
sh
    docker-compose exec -T php composer export-conf
    
sh
    docker-compose exec -T php composer site-install preprod || docker-compose exec -T php composer site-update preprod
    
sh
docker-compose exec -T php composer install
sh
docker-compose exec -T php composer update
sh
sudo docker-compose exec php php -m