Skip to content

Commit dccd93e

Browse files
authored
Merge pull request #187 from QKing-Official/main
Update web.php
2 parents ad4fbd5 + dca027e commit dccd93e

3 files changed

Lines changed: 20 additions & 17 deletions

File tree

routes/blueprint/application.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?php
22

33
foreach (File::allFiles(__DIR__ . '/application') as $partial) {
4-
if ($partial->getExtension() == 'php') {
5-
Route::prefix('/'.basename($partial->getFilename(), '.php'))
6-
->group(function () use ($partial) {require_once $partial->getPathname();}
7-
);
8-
}
9-
}
4+
if ($partial->getExtension() == 'php' && file_exists($partial->getPathname())) {
5+
Route::prefix('/'.basename($partial->getFilename(), '.php'))
6+
->group(function () use ($partial) {
7+
require_once $partial->getPathname();
8+
});
9+
}
10+
}

routes/blueprint/client.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
use Pterodactyl\BlueprintFramework\Controllers\ExtensionRouteController;
44

55
foreach (File::allFiles(__DIR__ . '/client') as $partial) {
6-
if ($partial->getExtension() == 'php') {
7-
Route::prefix('/'.basename($partial->getFilename(), '.php'))
8-
->group(function () use ($partial) {require_once $partial->getPathname();}
9-
);
10-
}
6+
if ($partial->getExtension() == 'php' && file_exists($partial->getPathname())) {
7+
Route::prefix('/'.basename($partial->getFilename(), '.php'))
8+
->group(function () use ($partial) {
9+
require_once $partial->getPathname();
10+
});
11+
}
1112
}
1213

1314
/* Routes internally used by Blueprint. */

routes/blueprint/web.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?php
22

33
foreach (File::allFiles(__DIR__ . '/web') as $partial) {
4-
if ($partial->getExtension() == 'php') {
5-
Route::prefix('/'.basename($partial->getFilename(), '.php'))
6-
->group(function () use ($partial) {require_once $partial->getPathname();}
7-
);
8-
}
9-
}
4+
if ($partial->getExtension() == 'php' && file_exists($partial->getPathname())) {
5+
Route::prefix('/'.basename($partial->getFilename(), '.php'))
6+
->group(function () use ($partial) {
7+
require_once $partial->getPathname();
8+
});
9+
}
10+
}

0 commit comments

Comments
 (0)