Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSR-4出来了 #5

Closed
weakish opened this issue Jan 17, 2014 · 9 comments
Closed

PSR-4出来了 #5

weakish opened this issue Jan 17, 2014 · 9 comments

Comments

@weakish
Copy link

weakish commented Jan 17, 2014

如题

@thbourlove
Copy link
Collaborator

@weakish 你可以考虑翻译一下,提个pull request嘛。

@hfcorriez
Copy link
Owner

多谢提醒,最近事多,暂时没空。 @thbourlove 说的不错 可以一起来写

@872409
Copy link

872409 commented Apr 16, 2014

@hfcorriez
PSR-4 3. 范例中 第一个例子: 实际的类文件路径: ./acme-log-writer/lib/File_Writer.php 这个是不是错了?根据:

  • 每一个在类名中的 _ 符号都会被转化成 DIRECTORY_SEPARATOR

应该是 ./acme-log-writer/lib/File/Writer.php 而不是 ./acme-log-writer/lib/File_Writer.php,不知道在下理解的对否?

完整的类名 命名空间前缀 基础目录 实际的类文件路径
\Acme\Log\Writer\File_Writer Acme\Log\Writer ./acme-log-writer/lib/ ./acme-log-writer/lib/File_Writer.php 应该是: ./acme-log-writer/lib/File/Writer.php

hfcorriez pushed a commit that referenced this issue Apr 16, 2014
Add file PSR-1-basic-coding-standard.md version fr.
hfcorriez pushed a commit that referenced this issue Apr 16, 2014
Revisión y correciones de PSR-0 por @aferrandini
hfcorriez pushed a commit that referenced this issue Apr 16, 2014
clarified what happens when alternative proposals replace original proposals
@thbourlove
Copy link
Collaborator

@xuxiao
非常抱歉,是翻译出了问题。psr4里下划线_在类名中是没有任何特殊意义的。所以例子没错。
每一个在类名中的 _ 符号都会被转化成 DIRECTORY_SEPARATOR。是psr0的规范。翻译的人估计不小心复制粘贴了psr0的规范过来。

@hfcorriez
Copy link
Owner

@thbourlove @xuxiao 刚看到确实如此,没有仔细核对。

@872409
Copy link

872409 commented Apr 16, 2014

@thbourlove @hfcorriez
嗯,刚看了一下 https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md
确实翻译错了:

  • Underscores have no special meaning in any portion of the fully qualified class name.

感谢你们的付出和努力![100个赞]

hfcorriez added a commit that referenced this issue Apr 16, 2014
@hfcorriez
Copy link
Owner

see #8

hfcorriez added a commit that referenced this issue Apr 16, 2014
@hfcorriez
Copy link
Owner

如果有空,请一起来 review!

@hfcorriez
Copy link
Owner

已经对翻译进行了校对和优化,感谢各位的热心和努力! @xuxiao @thbourlove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants