Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap file #11

Open
Petah opened this issue Nov 8, 2011 · 3 comments
Open

Bootstrap file #11

Petah opened this issue Nov 8, 2011 · 3 comments

Comments

@Petah
Copy link
Contributor

Petah commented Nov 8, 2011

Another feature for thought.

Instead of having a default php bootstrap file called phpmig.php, perhaps a configuration file would be better, such as .phpmig

A few reasons for this would be:

  • phpmig.php cannot be run standalone, and throws errors
  • phpmig.php is accessible (by default) with Apache (.phpmig would not be)
  • .phpmig could point to an appropriate bootstrap (or even multiple php files to be run)
  • .phpmig could point to the migrations directory
  • .phpmig would be more easily extendable to add extra properties in the future

The .phpmig format could be as simple as an INI, or perhaps even YAML, JSON, or XML

@davedevelopment
Copy link
Owner

I started out with a config file, but found it too inflexible. I like having the bootstrap as the main entry point, perhaps we could make the bootstrap an executable unto itself.

As for being accessible via apache, I don't think it makes any odds for me. If you can protect dot files, you can protect a single phpmig.php file?

That's not to say I'm against configuration files, they could have their place, but I'd rather it be secondary to the bootstrap. Just about every project I've come across has their own configuration and bootstrapping already, the phpmig bootstrap is there to try and take advantage of that.

@Petah
Copy link
Contributor Author

Petah commented Nov 8, 2011

Perhaps phpmig could even look for both .phpmig and phpmig.php

Another reason I would perfer not to have a phpmig.php bootstrap is because my projects already have a bootstrap which makes models/DBs globally available. So I find it kinda pointless to have a bootstrap to call my bootstrap.

The Apache access is not so much of a major. It just by default any file starting with a . is hidden and not accessible. But yes you could configure Apache not to allow access to specific files.

@davedevelopment
Copy link
Owner

But do your projects have a config file? If so, wouldn't it be kind of pointless to have a phpmig config file, that calls your bootstrap, that calls your config file? And if that work wasn't done in the bootstrap file (that phpmig generates for you), phpmig would have to do it anyway?

I think it's just a differing of opinions. Like you say, in my projects, the project config file and the project bootstrap do all the hard work, like setting up services, switching config for development/testing/staging/production environments (which can be a lot of changes) and having phpmig piggy back off that is quick and easy.

If you feel that strongly about it, I'm happy to merge it in, as long as it doesn't replace the phpmig.php

Otherwise feel free to fork?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants