Skip to content

Commit

Permalink
Change default control panel url from 'admin.php' to 'admin'
Browse files Browse the repository at this point in the history
This should avoid issues with web servers that are configured to treat .php as a file match and not route the request through Laravel's index.php entrypoint
  • Loading branch information
bryannielsen committed Sep 26, 2024
1 parent dac88be commit 048ad2c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Updated [Rebing/GraphQL](https://github.com/rebing/graphql-laravel) Dependency from version 8.6 to 9.2
- Updated [Rcrowe/TwigBridge](https://github.com/rcrowe/TwigBridge) Dependency from version 0.14.1 to 0.14.3
- Relaxed GraphQL handling of fieldtypes during schema generation. Now errors will be logged but schemas can still be built
- Default url for ExpressionEngine Control Panel is now `admin` instead of `admin.php`. This can be changed in `config/coilpack.php`.

## [1.4.2] - 2024-09-26

Expand Down
2 changes: 1 addition & 1 deletion config/coilpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* URL to access the ExpressionEngine control panel
*/
'admin_url' => 'admin.php',
'admin_url' => 'admin',

/**
* If you wish to provide your own implementation of the Member model
Expand Down
2 changes: 1 addition & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/

Route::any(
config('coilpack.admin_url', 'admin.php'),
config('coilpack.admin_url', 'admin'),
\Expressionengine\Coilpack\Controllers\AdminController::class
)->name('coilpack.admin');

Expand Down
16 changes: 8 additions & 8 deletions src/Bootstrap/LoadExpressionEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ public function controlPanel()
putenv('EE_INSTALL_MODE=FALSE');
$this->constants['REQ'] = 'CP';
$this->constants['MASKED_CP'] = true;
$this->constants['SELF'] = config('coilpack.admin_url', config('coilpack.admin_url', 'admin.php'));
$this->constants['EESELF'] = config('coilpack.admin_url', config('coilpack.admin_url', 'admin.php'));
$this->constants['SELF'] = config('coilpack.admin_url', 'admin');
$this->constants['EESELF'] = config('coilpack.admin_url', 'admin');

return $this;
}
Expand Down Expand Up @@ -116,8 +116,8 @@ public function updater()
[
'REQ' => 'CP',
'MASKED_CP' => true,
'SELF' => config('coilpack.admin_url', 'admin.php'),
'EESELF' => config('coilpack.admin_url', 'admin.php'),
'SELF' => config('coilpack.admin_url', 'admin'),
'EESELF' => config('coilpack.admin_url', 'admin'),
'INSTALL_MODE' => true,
]
);
Expand All @@ -130,8 +130,8 @@ public function installer()
putenv('EE_INSTALL_MODE=TRUE');
$this->constants['REQ'] = 'CP';
$this->constants['MASKED_CP'] = true;
$this->constants['SELF'] = config('coilpack.admin_url', 'admin.php');
$this->constants['EESELF'] = config('coilpack.admin_url', 'admin.php');
$this->constants['SELF'] = config('coilpack.admin_url', 'admin');
$this->constants['EESELF'] = config('coilpack.admin_url', 'admin');
$this->constants['INSTALL_MODE'] = true;

// Offer some convenient defaults for install wizard
Expand All @@ -150,9 +150,9 @@ public function installer()

// The SCRIPT_FILENAME must match EESELF constant defined above.
// The installer/controller/wizard.php file uses both values to determine the base_path
$_SERVER['SCRIPT_FILENAME'] = realpath($this->basePath).Str::start(config('coilpack.admin_url', 'admin.php'), '/');
$_SERVER['SCRIPT_FILENAME'] = realpath($this->basePath).Str::start(config('coilpack.admin_url', 'admin'), '/');
// PHP_SELF is used to determine the site_url in installer/controller/wizard
$_SERVER['PHP_SELF'] = Str::start(config('coilpack.admin_url', 'admin.php'), '/');
$_SERVER['PHP_SELF'] = Str::start(config('coilpack.admin_url', 'admin'), '/');

return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/CoilpackCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function install()

$this->installRelease($releases[$release]);

$this->info('Finish installing ExpressionEngine at '.url(config('coilpack.admin_url', 'admin.php')));
$this->info('Finish installing ExpressionEngine at '.url(config('coilpack.admin_url', 'admin')));
}

public function availableReleases()
Expand Down
2 changes: 1 addition & 1 deletion src/Routing/CoilpackRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function coilpack()
$this->group(['namespace' => $namespace], function () use ($options) {
if ($options['admin'] ?? true) {
$this->any(
config('coilpack.admin_url', 'admin.php'), \Expressionengine\Coilpack\Controllers\AdminController::class
config('coilpack.admin_url', 'admin'), \Expressionengine\Coilpack\Controllers\AdminController::class
)->name('coilpack.admin');
}

Expand Down

0 comments on commit 048ad2c

Please sign in to comment.