forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmagento
executable file
·39 lines (37 loc) · 1.01 KB
/
magento
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
#!/usr/bin/env php
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
if (PHP_SAPI !== 'cli') {
echo 'bin/magento must be run as a CLI application';
exit(1);
}
try {
require __DIR__ . '/../app/bootstrap.php';
} catch (\Exception $e) {
echo 'Autoload error: ' . $e->getMessage();
exit(1);
}
try {
$handler = new \Magento\Framework\App\ErrorHandler();
set_error_handler([$handler, 'handler']);
$application = new Magento\Framework\Console\Cli('Magento CLI');
$application->run();
} catch (\Throwable $e) {
while ($e) {
if ($e->getFile()) {
echo sprintf("\nThere is an error in %s", $e->getFile());
if ($e->getLine()) {
echo sprintf(" at line: %d", $e->getLine());
}
echo "\n";
}
echo $e->getMessage();
echo $e->getTraceAsString();
echo "\n\n";
$e = $e->getPrevious();
}
exit(Magento\Framework\Console\Cli::RETURN_FAILURE);
}