by vcherubini · 12y ago · 0 comments
Lots of suggestions:
* Don't write your own cron scripts, use Symfony Commands.
* Delete the Acme Bundle.
* Don't store your vendor directory in Git! Completely unnecessary and waste of 47MB.
* Don't commit parameters.yml, that's what parameters.yml.dist is for.
* Use a migration tool (Doctrine Migrations are fine) instead of one big SQL dump.
* Not sure what mongodb/example.php is for.
* Why is all the plivo stuff in web/plivo/ instead of being a callable controller?
* Are you manually generating your Doctrine entities?
* Don't commit your asset directories (they should be symlinks).
* No need to use PHPMailer (or include the entire project in your repository), Symfony comes with Swiftmailer which is great.
* Same with src/Phone, add that library through Composer (https://packagist.org/packages/practo/libphonenumber-for-php).
The design looks great, but I wouldn't trust a lot of this (especially after seeing how many hosts and usernames and passwords you left scattered about).
It's not the attitude of saying that security isn't taken seriously that gets me upset. It's the condescension. Let people learn by making mistakes, sometimes there's no other feasible way. Think of how to be helpful, not condescending.
> Don't store your vendor directory in Git! Completely unnecessary and waste of 47MB.
While 47MB is indeed a bit large, storing vendor libraries alongside your code makes sure you have a working version when you pull down the repo. Nothing more frustrating than hunting down why the code you just checked out doesn't work.
> Don't commit your asset directories (they should be symlinks).
That depends on what you mean by assets. If there are binary assets needed for the app to run, they must be included. Imagine downloading a web app with all the icons and textures missing. Not good. And if source files exist for these assets, they should be in the repo, too (like PSDs or Inkscape SVGs)
You should commit your asset files in the Bundle, but not the ones in web/bundles/ because those are created by copying or symlinking the assets in your Bundle.
I find that it simplifies versioning as well as making it so you don't have to download individual dependencies. What is your suggestion otherwise?
Committing dependencies is a solid decision to avoid taking a dependency on a bunch of third parties.
I know what you are meant to do is check in your composer.json and composer.lock then do a composer install on the server.
But then you have a external dependency on your install process on live servers, which is a terrible idea. To got around this, I've seen companies say "we have our own package mirror". Or you could just check in the vendor folder?
Another reason I do it: My software package is used by people who aren't PHP programmers and I want them to be able to just grab the files and go with no fuss.
I do appreciate having the vendor folder in git takes space and is a pain ... but I think the trade off is worth it.
The only addition I'd give is to start changing your passwords… quickly.
Passwords were changed the second you mentioned them, and we'll be making all of these changes as soon as possible.