aubreypwd / wp-config-common
将通用配置插入到WordPress的wp-config.php文件中。
1.2.1
2022-07-20 20:21 UTC
Requires
- phpmailer/phpmailer: ^5.2
- spatie/macroable: ^1.0
- spatie/ray: ^1.34
README
composer require aubreypwd/wp-config-common
然后,添加到您的 wp-config.php
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) { require_once __DIR__ . '/vendor/autoload.php'; }
启用配置
您必须在上面要求autoload.php之前定义这个!
define( 'WP_CONFIG_COMMON', 'max-execution-3600, multisite, spatie-ray, tunnel, noemail, mailhog' );
max-execution-3600
简单尝试将max_execution_time设置为一个小时(用于调试等)。
install-multisite
在您的数据库中尚未安装多站之前,请使用此配置。启用后,前往/wp-admin/network.php并安装多站。完成后,您可以使用multisite轻松开关多站。
- 如果您未指定
SUBDOMAIN_INSTALL,我们假设为false。 - 如果您未指定
DOMAIN_CURRENT_SITE,我们假设为$_SERVER['HTTP_HOST']
multisite
配置多站(注意:首先使用install-multisite)。
spatie-ray
将所有PHP警告和错误推送到Spatie Ray™。
设置define( 'SPATIE_RAY_NO_WARNINGS', true )'以停止警告。设置define( 'SPATIE_RAY_NO_ERRORS', true )'以停止错误。
tunnel
尝试自动欺骗WordPress,使其认为网站(仅限单站点)是代理。与localtunnel和ngrock兼容。
no-email
通过覆盖函数停止wp_mail工作。您可以使用覆盖函数的返回值定义WP_MAIL_RETURN,默认值为false。
mailhog
将所有电子邮件转发到localhost上的Mailhog(使用MAILHOG_HOST进行更改),端口为1025(使用MAILHOG_PORT进行更改)。
您还可以使用MAILHOG_FROM_EMAIL、MAILHOG_FROM_NAME和MAILHOG_AUTH进行进一步配置。
注意,将覆盖no-email。 通过覆盖wp_mail()工作。