diff --git a/library/think/Route.php b/library/think/Route.php index 63a6e4c9..ffc6dd7f 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -69,8 +69,8 @@ class Route { if (is_array($name)) { self::${$var} = self::${$var}+$name; - } elseif (empty($name)) { - return self::${$var}; + } elseif (empty($value)) { + return empty($name) ? self::${$var} : self::${$var}[$name]; } else { self::${$var}[$name] = $value; } diff --git a/library/think/log/alarm/Email.php b/library/think/log/alarm/Email.php index 0d9e52f0..531666c4 100644 --- a/library/think/log/alarm/Email.php +++ b/library/think/log/alarm/Email.php @@ -30,11 +30,11 @@ class Email * 通知发送接口 * @access public * @param string $msg 日志信息 - * @return void + * @return bool */ public function send($msg = '') { - error_log($msg, 1, $this->config['address']); + return error_log($msg, 1, $this->config['address']); } } diff --git a/library/think/log/driver/File.php b/library/think/log/driver/File.php index 484e577b..ebc60167 100644 --- a/library/think/log/driver/File.php +++ b/library/think/log/driver/File.php @@ -73,8 +73,7 @@ class File $server = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_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'] : ''; - error_log("[{$now}] {$server} {$remote} {$uri}\r\n{$info}\r\n", 3, $destination); - return true; + return error_log("[{$now}] {$server} {$remote} {$uri}\r\n{$info}\r\n", 3, $destination); } } diff --git a/tests/thinkphp/library/think/routeTest.php b/tests/thinkphp/library/think/routeTest.php index 93b5e113..8fbf1298 100644 --- a/tests/thinkphp/library/think/routeTest.php +++ b/tests/thinkphp/library/think/routeTest.php @@ -65,7 +65,7 @@ class routeTest extends \PHPUnit_Framework_TestCase public function testRouteMap() { 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')); }