From ba72cf44eff6ade1e5370b4e7ead6a329f61f080 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 10 Dec 2015 13:31:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=AF=E5=BE=84=E7=94=A8DS=E5=B8=B8=E9=87=8F?= =?UTF-8?q?=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/app.php | 8 ++++---- library/think/create.php | 24 ++++++++++++------------ library/think/loader.php | 10 +++++----- library/think/log/driver/file.php | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/library/think/app.php b/library/think/app.php index 9c596aed..562fcb06 100644 --- a/library/think/app.php +++ b/library/think/app.php @@ -130,7 +130,7 @@ class App // 操作绑定到类:模块\controller\控制器\操作类 private static function bindActionClass($emptyController) { - if (is_dir(MODULE_PATH . CONTROLLER_LAYER . '/' . str_replace('.', '/', CONTROLLER_NAME))) { + if (is_dir(MODULE_PATH . CONTROLLER_LAYER . DS . str_replace('.', DS, CONTROLLER_NAME))) { $namespace = MODULE_NAME . '\\' . CONTROLLER_LAYER . '\\' . str_replace('.', '\\', CONTROLLER_NAME) . '\\'; } else { // 空控制器 @@ -181,7 +181,7 @@ class App private static function initModule($module, &$config) { // 定位模块目录 - $module = COMMON_MODULE == $module ? '' : $module . '/'; + $module = COMMON_MODULE == $module ? '' : $module . DS; // 加载初始化文件 if (is_file(APP_PATH . $module . 'init' . EXT)) { @@ -324,8 +324,8 @@ class App // 模块初始化 if (MODULE_NAME && !in_array(MODULE_NAME, $config['deny_module_list']) && is_dir(APP_PATH . MODULE_NAME)) { Hook::listen('app_begin'); - define('MODULE_PATH', APP_PATH . MODULE_NAME . '/'); - define('VIEW_PATH', MODULE_PATH . VIEW_LAYER . '/'); + define('MODULE_PATH', APP_PATH . MODULE_NAME . DS); + define('VIEW_PATH', MODULE_PATH . VIEW_LAYER . DS); // 初始化模块 self::initModule(MODULE_NAME, $config); diff --git a/library/think/create.php b/library/think/create.php index 03c3ea00..7ab505be 100644 --- a/library/think/create.php +++ b/library/think/create.php @@ -79,7 +79,7 @@ class Create // 创建子目录和文件 foreach ($list as $path => $file) { - $modulePath = APP_PATH . $module . '/'; + $modulePath = APP_PATH . $module . DS; if ('__dir__' == $path) { // 生成子目录 foreach ($file as $dir) { @@ -98,7 +98,7 @@ class Create } else { // 生成相关MVC文件 foreach ($file as $val) { - $filename = $modulePath . $path . '/' . Loader::parseName($val) . EXT; + $filename = $modulePath . $path . DS . Loader::parseName($val) . EXT; switch ($path) { case CONTROLLER_LAYER: // 控制器 $content = "config['file_size']) <= filesize($destination)) { - rename($destination, dirname($destination) . '/' . time() . '-' . basename($destination)); + rename($destination, dirname($destination) . DS . time() . '-' . basename($destination)); } error_log("[{$now}] {$_SERVER['SERVER_ADDR']} {$_SERVER['REMOTE_ADDR']} {$_SERVER['REQUEST_URI']}\r\n{$log}\r\n", 3, $destination);