Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bundles] Rename getPublicPath() as getPublicDir()#32452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:4.4fromjaviereguiluz:continue_31975
Jul 12, 2019

Conversation

@javiereguiluz
Copy link
Member

QA
Branch?4.4
Bug fix?no
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PRI'll add this if approved

While documenting#31975 (seesymfony/symfony-docs#11930) I realized that thegetPublicPath() method name is not consistent with the rest of Symfony.

In Symfony, "path" is usually associated to routes and we use "dir" for things similar to this:

So, this PR proposes to renamegetPublicPath() asgetPublicDir()

ro0NL, faizanakram99, yceruto, and hhamon reacted with thumbs up emoji
@fabpot
Copy link
Member

One difference though is thatgetCacheDir() andgetLogDir() are returning absolute paths. Here, we return relative paths.

@javiereguiluz
Copy link
MemberAuthor

I haven't thought about that 🤔 To me, "dir" can mean both relative and absolute, such as in this example:

composer-dir

But if this is confusing to people, we can close this.

@linaori
Copy link
Contributor

linaori commentedJul 9, 2019
edited
Loading

Asdir stands fordirectory, it doesn't assume absolute or relative paths

A directory is a "folder", a place where you can put files or other directories (and special files, devices, symlinks...). It is a container for filesystem objects.

A path is a string that specify how to reach a filesystem object (and this object can be a file, a directory, a special file, ...).

Example: you have (probably, depending on your system) a file where system messages are logged, called syslog.

[ ... ]

https://unix.stackexchange.com/questions/131561/what-is-the-difference-between-path-and-directory

Copy link
Member

@fabpotfabpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Fair enough

@trigger_error('Not defining "getPublicPath()" method is deprecated since Symfony 4.4 and will not be supported in 5.0.',E_USER_DEPRECATED);
$publicPath ='Resources/public';
if (!method_exists($bundle,'getPublicDir')) {
@trigger_error(sprintf('Not defining "getPublicDir()" methodin the "%s" classis deprecated since Symfony 4.4 and will not be supported in 5.0.',get_class($bundle)),E_USER_DEPRECATED);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

\get_class, as reported by fabbot

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

GTM once fabbot is green :)

@fabpot
Copy link
Member

Thank you@javiereguiluz.

@fabpotfabpot merged commit4ab2f99 intosymfony:4.4Jul 12, 2019
fabpot added a commit that referenced this pull requestJul 12, 2019
…ereguiluz)This PR was squashed before being merged into the 4.4 branch (closes#32452).Discussion----------[Bundles] Rename getPublicPath() as getPublicDir()| Q             | A| ------------- | ---| Branch?       | 4.4| Bug fix?      | no| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets | -| License       | MIT| Doc PR        | I'll add this if approvedWhile documenting#31975 (seesymfony/symfony-docs#11930) I realized that the `getPublicPath()` method name is not consistent with the rest of Symfony.In Symfony, "path" is usually associated to routes and we use "dir" for things similar to this:* `getCacheDir()` and `getLogdir()` to override Symfony structure (https://symfony.com/doc/current/configuration/override_dir_structure.html)* `binDir`, `configDir`, `srcDir`, `varDir`, `publicDir` in Symfony Flex recipes (https://github.com/symfony/recipes) to override the dir structureSo, this PR proposes to rename `getPublicPath()` as `getPublicDir()`Commits-------4ab2f99 [Bundles] Rename getPublicPath() as getPublicDir()
@nicolas-grekasnicolas-grekas modified the milestones:next,4.4Oct 27, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@ycerutoycerutoyceruto left review comments

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

7 participants

@javiereguiluz@fabpot@linaori@nicolas-grekas@stof@yceruto@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp