Documentation update
Closed this issue · 3 comments
The command will advise you to create an _ss_environment.php file; don't do that. The script then finishes with an error but don't worry, that's only because Silverstripe's database connection details haven't yet been set up.
It never asked me with 3.1.x-dev today.
php artisan silverstripe:password
This command is not allowed on the 'production' environment.
Need to add to public/silverstripe/mysite/_config.php
Director::set_environment_type('dev');
public/silverstripe/mysite/Page.php is now public/silverstripe/mysite/code/Page.php
The php artisan silverstripe:password
command is deliberately disabled on the production environment.
Please don't add Director::set_environment_type('dev');
to your _config.php
file, because Laravel sets the silverstripe environment for you automatically (see /src/Themonkeys/Silverstripe/Laravel.php:29). The problem you need to resolve is that Laravel isn't identifying your local
environment correctly.
Unfortunately Laravel assumes production by default (I disagree with that, I think it is much more sensible to assume local
), and that can happen easily on the command-line because it uses your system's hostname
which probably doesn't match any of your environment rules in app/bootstrap/start.php
.
Try running hostname
on the command line (if on unix), and adding a rule to match that value to your app/bootstrap/start.php
file (e.g. "*.local"
) so that Laravel can correctly identify your local
environment on the command line.