Skip to content

Commit

Permalink
Merge pull request #3 from elstc/fixes-redeclare-class-alias
Browse files Browse the repository at this point in the history
fixes redeclare class alias
  • Loading branch information
nojimage authored Dec 10, 2020
2 parents 2e4b69b + f82d008 commit 94018e4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
use Cake\Core\Configure;
use Cake\Core\Plugin;

class_alias(Configure::read(
'Elastic/MigrationManager.baseController',
Controller::class
), '\Elastic\MigrationManager\Controller\BaseController');
if (!class_exists('Elastic\MigrationManager\Controller\BaseController')) {
class_alias(Configure::read(
'Elastic/MigrationManager.baseController',
Controller::class
), 'Elastic\MigrationManager\Controller\BaseController');
}

// back port for CakePHP < 3.6
if (version_compare(Configure::version(), '3.6.0', '<')) {
if (!class_exists('Cake\Http\Exception\NotFoundException')) {
class_alias('Cake\Network\Exception\NotFoundException', 'Cake\Http\Exception\NotFoundException');
}

Expand Down

0 comments on commit 94018e4

Please sign in to comment.