Skip to content

Conversation

novia713
Copy link
Contributor

@novia713 novia713 commented Dec 6, 2016

this comes from #2969

it's a fresh and actulized PR for easy merge 😉

@novia713
Copy link
Contributor Author

novia713 commented Dec 6, 2016

##CAUTION:

i added to my composer.json of drupalconsole this package →
https://packagist.org/packages/novia713/maginot
this is mandatory to work

strangely, it didn't work with the actual drupalconsole code, so i had to do a
composer require novia713/maginot
on my drupal directory.

--

##WHAT THIS PR DOES

site:mode dev
adds

<?php include __DIR__ . "/settings.local.php"; ?>

to settings.php and comments out the cache bins lines in settings.local.php

site:mode prod
removes the include to settings.local.php in settings.php

that's all! 🎆

@FatherShawn
Copy link
Contributor

But what if the user wants to check site function in mode prod locally? We have our local db creds and so forth in settings.local.php

@novia713
Copy link
Contributor Author

novia713 commented Dec 6, 2016

@FatherShawn hmmm maybe i'm wrong, but AFAIK the settings.local.php should not have credentials for any (nor dev nor prod) site

here it is the description of the settings.local.php file in the settings.php

Typically used to disable

  • caching, JavaScript/CSS compression, re-routing of outgoing emails, and
  • other things that should not happen on development and testing sites.

@FatherShawn
Copy link
Contributor

We use it for credentials to the local developer's site, not a server. And it's common for our devs to switch site mode on and off locally, so site:mode is used in local dev for us.

@novia713
Copy link
Contributor Author

novia713 commented Dec 7, 2016

@FatherShawn so, if i understand well, you have the include 'settings.local.php' at the end of the settings.php, in that way you overwrite your db settings, right?
if this is so, i can do the include at the bottom at the settings.php too.

regarding testing prod settings in local, i think i can do a special option for that, because i think your case is special and not everybody is in this usecase (having the dev db settings in settings.local.php)

would do this make you happy? ^^

/cc @enzolutions @jmolivas

@FatherShawn
Copy link
Contributor

FatherShawn commented Dec 7, 2016

That would take care of my use case, but I'm imagining that there are many use cases where settings.local.php is expected to be loaded when running in local development and also where developers would want to run the site in "prod" mode for testing. That's the core of what I'm trying to say.

Also, it will be AWESOME to have this automated - I've helped many devs, especially front end devs, in our company turn off all caching.

@novia713
Copy link
Contributor Author

novia713 commented Dec 7, 2016

so a site:mode prod --local would do the trick not deleting the following line?

<?php include __DIR__ . "/settings.local.php"; ?>

@novia713
Copy link
Contributor Author

novia713 commented Dec 7, 2016

@FatherShawn @jmolivas @enzolutions
just commited the --local option for site:mode prod
it just keeps the include to settings.local.php but comments out the cache bins lines in it 😉

@jmolivas
Copy link
Member

@novia713 Thanks for your contribution, your PR was merged. This will be included on the next release.

@jmolivas
Copy link
Member

@FatherShawn thanks for your participation on this PR.

@jmolivas jmolivas modified the milestone: 1.0.0-rc12 Dec 17, 2016
@FatherShawn
Copy link
Contributor

@jmolivas Thank you for the gift of Drupal Console! I hope to help out more in the new year - it is an awesome project :)

@LOBsTerr
Copy link
Member

@jmolivas it can be closed

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

Successfully merging this pull request may close these issues.

4 participants