Skip to content

Commit 897ec43

Browse files
committed
bug fixed for init ORouter.
1 parent bca9b36 commit 897ec43

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/ORouter.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class ORouter extends AbstractRouter
144144
*/
145145
protected $config = [
146146
// the routes php file.
147-
'routesFile' => null,
147+
'routesFile' => false,
148148

149149
// ignore last '/' char. If is True, will clear last '/'.
150150
'ignoreLastSep' => false,
@@ -156,7 +156,7 @@ class ORouter extends AbstractRouter
156156
// 1. If is a valid URI path, will intercept all request uri to the path.
157157
// 2. If is a closure, will intercept all request then call it
158158
// eg: '/site/maintenance' or `function () { echo 'System Maintaining ... ...'; }`
159-
'intercept' => null,
159+
'intercept' => false,
160160

161161
// auto route match @like yii framework
162162
// If is True, will auto find the handler controller file.
@@ -192,11 +192,6 @@ public function __construct(array $config = [])
192192

193193
$this->currentGroupPrefix = '';
194194
$this->currentGroupOption = [];
195-
196-
// load routes
197-
if (($file = $this->config['routesFile']) && is_file($file)) {
198-
require $file;
199-
}
200195
}
201196

202197
/**
@@ -214,6 +209,11 @@ public function setConfig(array $config)
214209
$this->config[$name] = $value;
215210
}
216211
}
212+
213+
// load routes
214+
if (($file = $this->config['routesFile']) && is_file($file)) {
215+
require $file;
216+
}
217217
}
218218

219219
/*******************************************************************************

0 commit comments

Comments
 (0)