-
Notifications
You must be signed in to change notification settings - Fork 0
set WP_HOME for environment #2
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
base: master
Are you sure you want to change the base?
Conversation
} | ||
$newLines[] = 'Config::define(\'WP_HOME\', \'' . get('url', 'https://') . '\');'; | ||
file_put_contents($file, implode('', $newLines)); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn’t this run on the remote host? it needs to run locally so you can commit it to git (or else a deploy would wipe the change).
current_path
would hold the path https://github.com/deployphp/deployer/blob/fb6f2154ef36f03e4e4b0644206b06722ee09fd8/recipe/common.php#L99.
you can use __DIR__
to get root of the project, you can confirm it works by looking at how the rsync works https://github.com/deployphp/deployer/blob/master/contrib/rsync.php#L135
note that no production.php config exists on sites currently, you should check it exists and is writable: is_writable()
$newLines[] = $line; | ||
} | ||
} | ||
$newLines[] = 'Config::define(\'WP_HOME\', \'' . get('url', 'https://') . '\');'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is quite difficult to read because of the escaping. compare to eg.
$newLines[] = 'Config::define(\'WP_HOME\', \'' . get('url', 'https://') . '\');'; | |
$newLines[] = sprintf("Config::define('WP_HOME', '%s');", get('url', 'https://')); |
$dbUser = ask('DB_USER', get('scaffold_machine_name', '')); | ||
$dbPassword = askHiddenResponse('DB_PASSWORD'); | ||
$wpEnv = ask('WP_ENV', currentHost()->getAlias()); | ||
$wpHome = ask('WP_HOME', $url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep these but default them to empty? And only add them if user has set them.
No description provided.