Skip to content

Commit b19c23b

Browse files
committed
Updated readme.
1 parent 0f7b0e5 commit b19c23b

File tree

5 files changed

+97
-18
lines changed

5 files changed

+97
-18
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@codingStandardsIgnoreFile
12
# Contributing
23

34
When contributing to this repository, please first discuss the change you wish to make via issue,

README.md

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,62 @@
11
# Drupal Composer
22

3-
[![Build Status][build-status-master]][build-url]
3+
[![Build Status](https://travis-ci.org/danielnv18/drupal-composer.svg?branch=master)](https://travis-ci.org/danielnv18/drupal-composer)
44

55
This project template provides a starter kit for managing your site dependencies
6-
with and it is inspired by [this project][drupal-composer]. This is meant as a
7-
starting point. Change things as need it.
6+
with. This is meant as a starting point. Change things as need it.
87

9-
## Create Project
10-
```bash
8+
## Getting Started
9+
10+
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
11+
12+
### Prerequisites
13+
14+
What things you need to install the software and how to install them
15+
16+
```
17+
Give examples
18+
```
19+
20+
### Installing
21+
22+
Replace `project-name` with the name of the folder or the proj ect
23+
24+
```
1125
composer create-project drupal-settings/drupal-composer project-name
1226
```
13-
Replace `project-name` with the name of the folder or the project
1427

15-
## Quick start
1628
In order to start the project run:
17-
```bash
29+
30+
```
1831
lando start
1932
```
20-
This will install your Drupal project. If there are any configuration files available, it will install
21-
Drupal with those configurations.
2233

23-
[drupal-composer]: https://github.com/drupal-composer/drupal-project
24-
[build-status-master]: https://travis-ci.org/danielnv18/drupal-composer.svg?branch=master
25-
[build-url]: https://travis-ci.org/danielnv18/drupal-composer.svg?branch=master
34+
This will install your Drupal project. If there are any configuration files available, it will install Drupal with those configurations.
35+
36+
## Built With
37+
38+
* [Drupal](https://www.drupal.org/) - The web framework used.
39+
* [Composer](https://getcomposer.org/) - Dependency Management.
40+
* [Lando](https://lando.dev/) - local development environment tool built on Docker container technology.
41+
42+
## Contributing
43+
44+
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
45+
46+
## Versioning
47+
48+
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/danielnv18/drupal-composer/releases).
49+
50+
## Authors
51+
52+
* **Daniel Noyola** - *Initial work* - [danielnv18](https://github.com/danielnv18)
53+
54+
See also the list of [contributors](https://github.com/danielnv18/drupal-composer/graphs/contributors) who participated in this project.
55+
56+
## License
57+
58+
This project is licensed under the GNU v2.0 License - see the [LICENSE.md](LICENSE.md) file for details
59+
60+
## Acknowledgments
61+
62+
* Inspiration: [drupal-composer/drupal-project](https://github.com/drupal-composer/drupal-project)

grumphp.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ parameters:
88
phplint: ~
99
yamllint: ~
1010
composer: ~
11-
composer_normalize: ~
1211
jsonlint: ~
1312
phpcpd:
1413
directory: './src'

load.env.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
/**
44
* @file
5-
* This file is included very early. See autoload.files in composer.json and
6-
* https://getcomposer.org/doc/04-schema.md#files
5+
* This file is included very early. See autoload.files in composer.json.
76
*/
87

98
use Dotenv\Dotenv;
109
use Dotenv\Exception\InvalidPathException;
10+
1111
/**
1212
* Load any .env file. See /.env.example.
1313
*/
1414
try {
1515
$dotenv = Dotenv::createImmutable(__DIR__);
1616
$dotenv->safeLoad();
1717
}
18-
catch (InvalidPathException $exception ) {
19-
// do nothing.
18+
catch (InvalidPathException $exception) {
19+
// Do nothing.
2020
}

scripts/php/Tasks.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
use DrupalFinder\DrupalFinder;
4+
use Drupal\Component\Utility\Crypt;
5+
use Robo\Tasks as RoboTasks;
6+
7+
/**
8+
* Class Tasks.
9+
*/
10+
class Tasks extends RoboTasks {
11+
12+
/**
13+
* Project setup task.
14+
*/
15+
public function setup() {
16+
$drupalFinder = new DrupalFinder();
17+
$drupalFinder->locateRoot(getcwd());
18+
19+
$current_dir = explode('/', $drupalFinder->getComposerRoot());
20+
$default_project = $current_dir[count($current_dir) - 1];
21+
$projectName = $this->askDefault("What's the project's name?", $default_project);
22+
$projectName = preg_replace('/\s+/', '-', strtolower(trim($projectName)));
23+
$this->say("Project: $projectName");
24+
25+
$this->taskReplaceInFile($drupalFinder->getComposerRoot() . '/.env.example')
26+
->from('drupal-composer')
27+
->to($projectName)
28+
->run();
29+
30+
$this->taskReplaceInFile($drupalFinder->getComposerRoot() . '/.lando.yml')
31+
->from('drupal-composer')
32+
->to($projectName)
33+
->run();
34+
35+
$hash = Crypt::randomBytesBase64(55);
36+
$this->taskReplaceInFile($drupalFinder->getComposerRoot() . '/.env.example')
37+
->from('pleaseChangeThisToADifferentRandomString')
38+
->to($hash)
39+
->run();
40+
}
41+
42+
}

0 commit comments

Comments
 (0)