Reputation: 18765
I am working on a Symfony 2 WebApp that uses the PayPal Rest API
to create and accept PayPal payments.
To be able to redirect each user to a PayPal page in his language, one has to create an Experience Profile for each language/locale.
Each Experience Profile
has to be created only once. For example once a profile for US
locale has been create, this profile can be re-used for every customer using the same locale:
XY
locale existsXY
locale and store it OR re-use existing oneEach profile has a unique ID. Thus I am looking for a method to store Locale/ID pairs. A simple solution would be a JSON file. But where to store this file within the Symfony structure?
Profiles are created on the fly when ever a user from a new country places a payment. Thus this data is created during runtime and because of this it does not belong into the standard config
dirs of Symfony I think. I do not even know if these folders should accessible/writeable by my code.
So: What is the right place to store such a file.
EDIT: As @JimL pointed out in the comments it would of course be possible to store the data in the DB. However the Payment Bundle I am working on, should be used in different projects and thus be as separated from the rest of the project as possible.
The goal here is, to store the data in a file, not in the DB. Of course the DB is much more efficient but in this special case a simple file will be sufficient.
The question is: Where to store this file? First idea is to use /MyBundle/Resources/config
since this dir holds all other config files. But is this the right place for files that change at run time as well?
Upvotes: 1
Views: 436
Reputation: 1110
app/ The application configuration, templates and translations.
bin/ Executable files (e.g. bin/console).
src/ The project's PHP code.
tests/ Automatic tests (e.g. Unit tests). Standard Directory Structure is:
var/ Generated files (cache, logs, etc.).
vendor/ The third-party dependencies.
web/ The web root directory.
You can put it in the standard var directory under your custom directory. Remember about permissions.
More general info on var directory: http://www.linfo.org/var.html
Upvotes: 2