Skip to content

Commit

Permalink
fix(autoload): autoload needs to happen before use of use. (#1546)
Browse files Browse the repository at this point in the history
* fix(autoload): autoload needs to happen before use of use.

* fix(namespace): Wrong namespace

* fix of the fix
  • Loading branch information
noone-silent authored Feb 26, 2025
1 parent 2e16ea6 commit 345be5b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions phalcon
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
* the LICENSE file that was distributed with this source code.
*/

// Autoload need to happen before the use of use.
try {
require dirname(__FILE__) . '/bootstrap/autoload.php';
} catch (\Throwable $e) {
fwrite(STDERR, $e->getMessage() . PHP_EOL);
exit(1);
}

use Phalcon\DevTools\Commands\Builtin\AllModels;
use Phalcon\DevTools\Commands\Builtin\Console;
use Phalcon\DevTools\Commands\Builtin\Controller;
Expand All @@ -30,8 +38,6 @@ use Phalcon\DevTools\Version;
use Phalcon\Events\Manager as EventsManager;

try {
require dirname(__FILE__) . '/bootstrap/autoload.php';

$vendor = sprintf('Phalcon DevTools (%s)', (new Version())->get());
print PHP_EOL . Color::colorize($vendor, Color::FG_GREEN, Color::AT_BOLD) . PHP_EOL . PHP_EOL;

Expand Down
2 changes: 1 addition & 1 deletion src/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace Phalcon\DevTools;

use Phalcon\support\Version as PhVersion;
use Phalcon\Support\Version as PhVersion;

/**
* This class allows to get the installed version of the Developer Tools
Expand Down

0 comments on commit 345be5b

Please sign in to comment.