Skip to content

Commit 345be5b

Browse files
authored
fix(autoload): autoload needs to happen before use of use. (#1546)
* fix(autoload): autoload needs to happen before use of use. * fix(namespace): Wrong namespace * fix of the fix
1 parent 2e16ea6 commit 345be5b

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Diff for: phalcon

+8-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
* the LICENSE file that was distributed with this source code.
1111
*/
1212

13+
// Autoload need to happen before the use of use.
14+
try {
15+
require dirname(__FILE__) . '/bootstrap/autoload.php';
16+
} catch (\Throwable $e) {
17+
fwrite(STDERR, $e->getMessage() . PHP_EOL);
18+
exit(1);
19+
}
20+
1321
use Phalcon\DevTools\Commands\Builtin\AllModels;
1422
use Phalcon\DevTools\Commands\Builtin\Console;
1523
use Phalcon\DevTools\Commands\Builtin\Controller;
@@ -30,8 +38,6 @@ use Phalcon\DevTools\Version;
3038
use Phalcon\Events\Manager as EventsManager;
3139

3240
try {
33-
require dirname(__FILE__) . '/bootstrap/autoload.php';
34-
3541
$vendor = sprintf('Phalcon DevTools (%s)', (new Version())->get());
3642
print PHP_EOL . Color::colorize($vendor, Color::FG_GREEN, Color::AT_BOLD) . PHP_EOL . PHP_EOL;
3743

Diff for: src/Version.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace Phalcon\DevTools;
1414

15-
use Phalcon\support\Version as PhVersion;
15+
use Phalcon\Support\Version as PhVersion;
1616

1717
/**
1818
* This class allows to get the installed version of the Developer Tools

0 commit comments

Comments
 (0)