Skip to content

Commit 49bed5b

Browse files
Refactor config.php (#158)
* Refactor config.php * Update stats.php * Update index.php * Fixed formatting errors * docs: Fix missing word Co-authored-by: Jonah Lawrence <jonah@freshidea.com>
1 parent 9d1d196 commit 49bed5b

File tree

8 files changed

+482
-104
lines changed

8 files changed

+482
-104
lines changed

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
TOKEN=
2+
USERNAME=

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
composer.phar
22
/vendor/
3-
src/config.php
3+
.env

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,11 @@ To get the GitHub API to run locally you will need to provide a token.
226226

227227
1. Visit [this link](https://github.com/settings/tokens/new?description=GitHub%20Readme%20Streak%20Stats) to create a new Personal Access Token
228228
2. Scroll to the bottom and click **"Generate token"**
229-
3. **Create a file** `config.php` in the `src` directory and replace `ghp_example123` with **your token** and `DenverCoder1` with **your username**:
229+
3. **Make a copy** of `.env.example` named `.env` in the root directory and add **your token** after `TOKEN=` and **your username** after `USERNAME=`:
230230

231231
```php
232-
<?php
233-
putenv("TOKEN=ghp_example123");
234-
putenv("USERNAME=DenverCoder1");
232+
TOKEN=
233+
USERNAME=
235234
```
236235

237236
### Running the app locally

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
},
2020
"require": {
2121
"php": "^7.4|^8.0",
22-
"ext-imagick": "*"
22+
"ext-imagick": "*",
23+
"vlucas/phpdotenv": "^5.3"
2324
},
2425
"require-dev": {
2526
"phpunit/phpunit": "^9"

0 commit comments

Comments
 (0)