Last active
December 16, 2015 14:38
-
-
Save EmanueleMinotto/7f1df17741f85d7a3bd3 to your computer and use it in GitHub Desktop.
PoC directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ | |
Acme | |
Package | |
Library.php | |
LibraryTest.php | |
composer.json | |
.gitignore | |
.gitattributes | |
acmescript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/.gitattributes export-ignore | |
/.gitignore export-ignore | |
/phpunit.xml.dist export-ignore | |
*Test.php export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vendor/ | |
phpunit.xml | |
composer.phar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"autoload": { | |
"exclude-from-classmap": [ | |
"*Test.php" | |
], | |
"psr-4": { | |
"Acme\\": "Acme" | |
} | |
}, | |
"bin": [ | |
"acmescript" | |
] | |
} |
I would have:
dist # if you have JS/CSS scripts, minified version
doc
src
Dummy.php
tests
Dummy.php
resources # if you have JS/CSS scripts
composer.json
.gitignore
.gitattributes
.editorconfig
.travis.yml
README.md
LICENSE.md
... config files
@theofidry I am using you variant, I think it's need to be a best practise in all projects
Agreed with @theofidry, I'm doring like that as well.
Finally found the time to reply, first of all: thank you for your comments :)
Uhm @theofidry your structure makes sense, but is it based on a document? Still seems something custom (dist/
more than other directories).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Acme\Package\Library
follows PSR-0 & PSR-4, I've just remove the commonsrc/
part.Is usally recommended to use a single vendor for every package, bundle, module, etc... the same concept exists on packagist.org with
vendor/*
Why not? Them could be excluded from library distribution and/or Composer (already lazy) autoloading with the
exclude-from-classmap
option.This could be useful too to prevent namespace importing in the
tests/
directory, often I see something like this:instead with this you can do:
Project configs should be shared in the project root or on the environment for not required things (for example: the .idea for PHPStorm).
There isn't a
bin/
directory, considering that every package shares a single bin script (in this example it'sacmescript
), it could be included in the same level of the project configuration.