Comments (9)
@weakish 你可以考虑翻译一下,提个pull request嘛。
from fig-standards.
多谢提醒,最近事多,暂时没空。 @thbourlove 说的不错 可以一起来写
from fig-standards.
@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 |
from fig-standards.
@xuxiao
非常抱歉,是翻译出了问题。psr4里下划线_
在类名中是没有任何特殊意义的。所以例子没错。
每一个在类名中的 _ 符号都会被转化成 DIRECTORY_SEPARATOR。是psr0的规范。翻译的人估计不小心复制粘贴了psr0的规范过来。
from fig-standards.
@thbourlove @xuxiao 刚看到确实如此,没有仔细核对。
from fig-standards.
@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个赞]
from fig-standards.
see #8
from fig-standards.
如果有空,请一起来 review!
from fig-standards.
已经对翻译进行了校对和优化,感谢各位的热心和努力! @xuxiao @thbourlove
from fig-standards.
Related Issues (6)
- 复杂的if条件该怎么写呢? HOT 1
- psr-2方法名命名规则 HOT 2
- 官方已经接受多语言翻译了,有必要把我们的东西反馈上游吧? HOT 1
- 不更新了吗?
- psr-2 不能在线阅读了 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fig-standards.