Skip to content

I18nExtractCommand and permissions #18844

@mirko-pagliai

Description

@mirko-pagliai

Description

I18nExtractCommand creates files with permissions of 664, but directories (e.g., resources/locales if it doesn't already exist) with permissions of 770.

I tried looking at the I18nExtractCommand::_writeFiles() method: the method calls Filesystem::dumpFile(), which in turn should call mkdir() (which defaults to 755, as I'd expect).

But this doesn't happen, because the I18nExtractCommand::_isPathUsable() method intervenes first, called by execute(), which creates the directory if it doesn't exist.

This isn't a big problem, but it's given me a few headaches more than once in the last few years, because some localizations wouldn't work, and I spent a lot of time investigating the domain name and filenames or other possible problems.

I don't open a PR directly, I know it would be enough to change I18nExtractCommand::_isPathUsable(), but I wonder:

  1. if there is an explicit reason for choosing 770 (but all the other features, such as bake's, don't do that);
  2. if there is a reason for not delegating to Filesystem.

CakePHP Version

5.2

PHP Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions