mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
Route类调整
This commit is contained in:
@@ -69,8 +69,8 @@ class Route
|
|||||||
{
|
{
|
||||||
if (is_array($name)) {
|
if (is_array($name)) {
|
||||||
self::${$var} = self::${$var}+$name;
|
self::${$var} = self::${$var}+$name;
|
||||||
} elseif (empty($name)) {
|
} elseif (empty($value)) {
|
||||||
return self::${$var};
|
return empty($name) ? self::${$var} : self::${$var}[$name];
|
||||||
} else {
|
} else {
|
||||||
self::${$var}[$name] = $value;
|
self::${$var}[$name] = $value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,11 +30,11 @@ class Email
|
|||||||
* 通知发送接口
|
* 通知发送接口
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $msg 日志信息
|
* @param string $msg 日志信息
|
||||||
* @return void
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function send($msg = '')
|
public function send($msg = '')
|
||||||
{
|
{
|
||||||
error_log($msg, 1, $this->config['address']);
|
return error_log($msg, 1, $this->config['address']);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,8 +73,7 @@ class File
|
|||||||
$server = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '0.0.0.0';
|
$server = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '0.0.0.0';
|
||||||
$remote = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0';
|
$remote = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0';
|
||||||
$uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
|
$uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
|
||||||
error_log("[{$now}] {$server} {$remote} {$uri}\r\n{$info}\r\n", 3, $destination);
|
return error_log("[{$now}] {$server} {$remote} {$uri}\r\n{$info}\r\n", 3, $destination);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ class routeTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function testRouteMap()
|
public function testRouteMap()
|
||||||
{
|
{
|
||||||
Route::map('hello', 'index/hello');
|
Route::map('hello', 'index/hello');
|
||||||
//$this->assertEquals('index/hello',Route::map('hello'));
|
$this->assertEquals('index/hello', Route::map('hello'));
|
||||||
$this->assertEquals(['type' => 'module', 'module' => ['index', 'hello', null]], Route::check('hello'));
|
$this->assertEquals(['type' => 'module', 'module' => ['index', 'hello', null]], Route::check('hello'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user