Skip to content
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.

Commit

Permalink
修复在Windows系统上代码自动生成报错的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yuan1994 committed Jan 4, 2017
1 parent 7ea690f commit 0a21599
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions extend/Generate.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ private function buildEdit($path, $pathTemplate, $fileName, $tableName, $code, $
$file = $path . "edit.html";

//TODO 自定义模板路径
if ($this->module == Request::instance()->module()) {
if ($this->module == Request::instance()->module() || !$this->module) {
$module = '';
} else {
$module = Request::instance()->module() . '@';
Expand Down Expand Up @@ -1190,7 +1190,8 @@ private function readConfig($module, $scope, $name = null, $default = '')
*/
private function parseCamelCase($name)
{
return preg_replace_callback('/((^|\\' . quotemeta(DS) . ')([a-z]))/', function ($matches) {
$pattern = DS == '\\' ? '/((^|\\\\)([a-z]))/' : '/((^|\\/)([a-z]))/';
return preg_replace_callback($pattern, function ($matches) {
return strtoupper($matches[3]);
}, trim($name, DS));
}
Expand Down

0 comments on commit 0a21599

Please sign in to comment.