Giter VIP home page Giter VIP logo

Comments (7)

samdark avatar samdark commented on June 9, 2024

put the PHP source in it's own directory

You mean src?

I would go with either PSR-4 or PSR-0

It is already PSR-4: https://github.com/cebe/markdown/blob/master/composer.json#L30

from markdown.

phpfui avatar phpfui commented on June 9, 2024

from markdown.

samdark avatar samdark commented on June 9, 2024

That's for @cebe to decide but I support this move.

from markdown.

phpfui avatar phpfui commented on June 9, 2024

from markdown.

cebe avatar cebe commented on June 9, 2024

what are the arguments for doing this? I only see one argument, that your tool is unable to distinguish files?

from markdown.

phpfui avatar phpfui commented on June 9, 2024

I think the primary reason is just to separate things so they are better defined for users and tools. Most PHP packages use an src directory, but it could be named source or something else. The point is to tell the user this is all that is really needed for this package to work. You can also point a tool at it one source directory, and it will have everything it needs to know about. Right now, you have to specifically exclude the test directory to just get the actual PHP source code the package uses.

Basically, you are almost there. Create a src directory. It would contain the and 4 php files in the root, plus the block and inline directories. Then a user could glance at the project and see block and inline are part of the package namespace. While bin and tests are obviously not part of the package, you really can't be sure unless you look at them specifically.

One example of why you might want this is if you were to grep the source for something, you might find matches in the test directory as well as the source, when you don't care about the tests. If you wanted to include the tests in the search, you simply start one level up. But searching just the source would then be easier.

In the end, what you have works. It is just not a typical PHP library layout. It keeps things a bit better organized in the end. Kind of the same reason we use namespaces, they keep things more organized.

Anyway, happy to submit a PR. I think it would be a good thing and make this package like most of the rest of the PHP community packages.

from markdown.

samwilson avatar samwilson commented on June 9, 2024

Relatedly, there's some good info at php-pds/skeleton about common directory structures for PHP projects. They recommend src/ and tests/ among other things.

I guess it mostly comes down to standardization, and making it slightly quicker for people new to a project to know where things are.

from markdown.

Related Issues (20)

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.