I'm developing an app that will be deployed automatically into cloud
servers. Is there a proper pattern to perform some setup on first run only?
By "setup" I mean running something as simple as an action in a controller
inside the same app. But of course this has to only happen once in the
lifetime of the app.

Considerations:
1) My app does not use a database.
2) My app is not a website; It's an app that will be ran using supervisor
mainly to manipulate image batches.
3) The "setup" has to be deployment-agnostic; as each cloud provider has
their own method of deployment I'd rather keep this at the app level.

My first idea was along the lines of always attempting to run the setup
code unless a specific file exists on the disk. So part of the setup
process creates the file and that's that.

And then I thought that ZF2 being created with not just websites in mind,
could even have this already built into the framework itself. A run through
the docs and code didn't reveal much on this, though.

Any ideas?

Cheers,
Julian.

Reply via email to