Skip to content

Commit

Permalink
feat: implement bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
kolotov committed Aug 26, 2023
1 parent debf1ff commit eb8c75a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ install:
validate:
composer validate

refresh:
composer dump-autoload

lint:
composer exec --verbose phpcs -- --standard=PSR12 src bin

Expand Down
1 change: 1 addition & 0 deletions bin/brain-games
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env docker-compose run php
<?php
require_once __DIR__ . '/../src/bootstrap.php';

use function BrainGames\Cli\greeting;

Expand Down
8 changes: 8 additions & 0 deletions src/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

$autoloadGlobalPath = __DIR__ . '/../../../autoload.php';
$autoloadLocalPath = __DIR__ . '/../vendor/autoload.php';

$autoloadPath = file_exists($autoloadGlobalPath) ? $autoloadGlobalPath : $autoloadLocalPath;

require_once $autoloadPath;

0 comments on commit eb8c75a

Please sign in to comment.