-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmason
More file actions
executable file
·43 lines (34 loc) · 1004 Bytes
/
Copy pathmason
File metadata and controls
executable file
·43 lines (34 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env php
<?php
/**
* Mason - BaseAPI CLI Tool
*
* Lightweight bootstrap script that delegates to MasonBootstrap class.
*/
// Minimal inline autoloader locator (needed before we can load classes)
$locateAutoloader = function (): ?string {
$paths = [
getcwd() . '/vendor/autoload.php',
__DIR__ . '/../vendor/autoload.php',
__DIR__ . '/../../autoload.php',
__DIR__ . '/../../../autoload.php'
];
foreach ($paths as $path) {
if (file_exists($path)) {
return $path;
}
}
return null;
};
$autoloader = $locateAutoloader();
if (!$autoloader) {
echo "Error: Could not find composer autoloader.\n";
echo "Please run 'composer install' first.\n";
exit(1);
}
require_once $autoloader;
// Delegate everything to the bootstrap class
use BaseApi\Console\MasonBootstrap;
$baseAppPath = MasonBootstrap::detectBasePath();
$bootstrap = new MasonBootstrap($baseAppPath);
exit($bootstrap->run($argv));