Skip to content

Commit

Permalink
Update CurdService.php
Browse files Browse the repository at this point in the history
  • Loading branch information
funadmin authored Mar 8, 2023
1 parent 30ec0b1 commit bdfc3ab
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/curd/service/CurdService.php
Original file line number Diff line number Diff line change
Expand Up @@ -699,13 +699,17 @@ protected function makeMenu(int $type = 1)
*/
public function makeFile($filename, $content)
{
if (is_file($filename) && !$this->force && !$this->jump) {
throw new \Exception($filename . '文件已经存在');
}
if (!is_dir(dirname($filename))) {
@mkdir(dirname($filename), 0755, true);
if(is_file($filename)){
if($this->force && !$this->jump){
file_put_contents($filename, $content);
}
}else{
if (!is_dir(dirname($filename))) {
@mkdir(dirname($filename), 0755, true);
}
file_put_contents($filename, $content);
}
file_put_contents($filename, $content);

}

protected function buildMenu($menuListArr, $type = 1)
Expand Down

0 comments on commit bdfc3ab

Please sign in to comment.