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

Studio: Add config constants to mu-plugins #766

Merged
merged 2 commits into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions vendor/wp-now/src/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,21 @@ set_error_handler(function($severity, $message, $file, $line) {
}
`
);

fs.writeFile(
path.join( muPluginsPath, '0-wp-config-constants-polyfill.php' ),
`<?php
// Define database constants if not already defined. It fixes the error
// for imported sites that don't have those defined e.g. WP Cloud and
// include plugins which try to access those directly e.g. Mailpoet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the comment to clearly state what is the purpose of the polyfill.

if (!defined('DB_NAME')) define('DB_NAME', 'database_name_here');
if (!defined('DB_USER')) define('DB_USER', 'username_here');
if (!defined('DB_PASSWORD')) define('DB_PASSWORD', 'password_here');
if (!defined('DB_HOST')) define('DB_HOST', 'localhost');
if (!defined('DB_CHARSET')) define('DB_CHARSET', 'utf8');
if (!defined('DB_COLLATE')) define('DB_COLLATE', '');
`
);
}

export function getWordPressVersionPath( wpVersion: string ) {
Expand Down
Loading