Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
87 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php declare (strict_types = 1); | ||
|
||
namespace Wavevision\DIServiceAnnotation; | ||
|
||
use Nette\StaticClass; | ||
use Wavevision\Utils\Path; | ||
|
||
class Bootstrap | ||
{ | ||
|
||
use StaticClass; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private static $rootDir; | ||
|
||
/** | ||
* @param string $rootDir | ||
* @param array<string, string> $mappings | ||
*/ | ||
public static function boot(string $rootDir, array $mappings): void | ||
{ | ||
self::$rootDir = $rootDir; | ||
foreach ($mappings as $source => $output) { | ||
(new ExtractServices(new Configuration(self::fromRoot($source), self::fromRoot($output))))->run(); | ||
} | ||
} | ||
|
||
private static function fromRoot(string $path): string | ||
{ | ||
return Path::join(self::$rootDir, $path); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters