Skip to content

[BUG][PHP] Replace File.separator in PHP generators with / (Windows) #2004

@jfastnacht

Description

@jfastnacht
Description

In the PHP Codegen files (e.g. AbstractPhpCodegen.java and PhpSymfonyServerCodegen.java) there is a lot of usage of the File.seperator placeholder. While it doesn't make a difference for Linux and Mac users, it does for Windows users of the codegen, especially if the placeholder, which will become a backslash, is mixed with hardcoded forward slashes. In PHP there is no reason to make Windows specific excuses, so everything should be replaced with forward slashes.

Anyways, since it is dangerous to just replace everything due to possible side effects and I don't wanted to replace huge chunks of code used in several generators by myself without telling anyone, I've decided to put this into an issue, discuss it and get feedback from the PHP Technical Comittee on it.

I've already changed some files in #1892 , but I think it's better to make proper bug PRs for fixing the slash issue and the main issue of the #1892 seperately.

openapi-generator version

master-branch

Command line used for generation

Any PHP generator under Windows.

Steps to reproduce
  1. Generate PHP code (Windows)
  2. Check changes with git status
Related issues/PRs
Suggest a fix

Replace File.seperator with slashes in PHP code generators.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions