Git Product home page Git Product logo

Comments (9)

thbourlove avatar thbourlove commented on September 6, 2024

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

from fig-standards.

hfcorriez avatar hfcorriez commented on September 6, 2024

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

from fig-standards.

872409 avatar 872409 commented on September 6, 2024

@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.

thbourlove avatar thbourlove commented on September 6, 2024

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

from fig-standards.

hfcorriez avatar hfcorriez commented on September 6, 2024

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

from fig-standards.

872409 avatar 872409 commented on September 6, 2024

@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.

hfcorriez avatar hfcorriez commented on September 6, 2024

see #8

from fig-standards.

hfcorriez avatar hfcorriez commented on September 6, 2024

如果有空,请一起来 review!

from fig-standards.

hfcorriez avatar hfcorriez commented on September 6, 2024

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

from fig-standards.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.