mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Wrap page builders compat with init hook to avoid error when called too early. Also add phpmyadmin to ddev as not included in latest 1.22.0 version
This commit is contained in:
parent
23c0a2e974
commit
5cd5a49016
5 changed files with 107 additions and 9 deletions
10
.ddev/addon-metadata/phpmyadmin/manifest.yaml
Normal file
10
.ddev/addon-metadata/phpmyadmin/manifest.yaml
Normal file
|
@ -0,0 +1,10 @@
|
|||
name: phpmyadmin
|
||||
repository: ddev/ddev-phpmyadmin
|
||||
version: v0.3.0
|
||||
install_date: "2023-08-02T12:20:36+02:00"
|
||||
project_files:
|
||||
- docker-compose.phpmyadmin.yaml
|
||||
- docker-compose.phpmyadmin-norouter.yaml
|
||||
- commands/host/phpmyadmin
|
||||
global_files: []
|
||||
removal_actions: []
|
52
.ddev/commands/host/phpmyadmin
Executable file
52
.ddev/commands/host/phpmyadmin
Executable file
|
@ -0,0 +1,52 @@
|
|||
#!/bin/bash
|
||||
|
||||
## #ddev-generated: If you want to edit and own this file, remove this line.
|
||||
## Description: Launch a browser with PhpMyAdmin
|
||||
## Usage: phpmyadmin
|
||||
## Example: "ddev phpmyadmin"
|
||||
|
||||
DDEV_PHPMYADMIN_PORT=8036
|
||||
DDEV_PHPMYADMIN_HTTPS_PORT=8037
|
||||
|
||||
FULLURL=${DDEV_PRIMARY_URL}
|
||||
HTTPS=""
|
||||
if [ ${DDEV_PRIMARY_URL%://*} = "https" ]; then HTTPS=true; fi
|
||||
|
||||
if [[ ! -z "${GITPOD_INSTANCE_ID}" ]] || [[ "${CODESPACES}" == "true" ]]; then
|
||||
FULLURL="${FULLURL/-${DDEV_HOST_WEBSERVER_PORT}/-${DDEV_PHPMYADMIN_PORT}}"
|
||||
else
|
||||
if [ "${HTTPS}" = "" ]; then
|
||||
FULLURL="${FULLURL%:[0-9]*}:${DDEV_PHPMYADMIN_PORT}"
|
||||
else
|
||||
FULLURL="${FULLURL%:[0-9]*}:${DDEV_PHPMYADMIN_HTTPS_PORT}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "${1:-}" ] ; then
|
||||
if [[ ${1::1} != "/" ]] ; then
|
||||
FULLURL="${FULLURL}/";
|
||||
fi
|
||||
|
||||
FULLURL="${FULLURL}${1}";
|
||||
fi
|
||||
|
||||
if [ "${DDEV_DEBUG:-}" = "true" ]; then
|
||||
printf "FULLURL $FULLURL\n" && exit 0
|
||||
fi
|
||||
|
||||
case $OSTYPE in
|
||||
linux-gnu)
|
||||
if [[ ! -z "${GITPOD_INSTANCE_ID}" ]]; then
|
||||
gp preview ${FULLURL}
|
||||
else
|
||||
xdg-open ${FULLURL}
|
||||
fi
|
||||
;;
|
||||
"darwin"*)
|
||||
open ${FULLURL}
|
||||
;;
|
||||
"win*"* | "msys"*)
|
||||
start ${FULLURL}
|
||||
;;
|
||||
esac
|
||||
|
4
.ddev/docker-compose.phpmyadmin-norouter.yaml
Normal file
4
.ddev/docker-compose.phpmyadmin-norouter.yaml
Normal file
|
@ -0,0 +1,4 @@
|
|||
#ddev-generated
|
||||
# If omit_containers[ddev-router] then this file will be replaced
|
||||
# with another with a `ports` statement to directly expose port 80 to 8036
|
||||
services: {}
|
27
.ddev/docker-compose.phpmyadmin.yaml
Normal file
27
.ddev/docker-compose.phpmyadmin.yaml
Normal file
|
@ -0,0 +1,27 @@
|
|||
#ddev-generated
|
||||
services:
|
||||
phpmyadmin:
|
||||
container_name: ddev-${DDEV_SITENAME}-phpmyadmin
|
||||
image: phpmyadmin:5
|
||||
working_dir: "/root"
|
||||
restart: "no"
|
||||
labels:
|
||||
com.ddev.site-name: ${DDEV_SITENAME}
|
||||
com.ddev.approot: $DDEV_APPROOT
|
||||
expose:
|
||||
- "80"
|
||||
environment:
|
||||
- PMA_USER=root
|
||||
- PMA_PASSWORD=root
|
||||
- PMA_HOST=db
|
||||
- PMA_PORT=3306
|
||||
- VIRTUAL_HOST=$DDEV_HOSTNAME
|
||||
- UPLOAD_LIMIT=4000M
|
||||
- HTTP_EXPOSE=8036:80
|
||||
- HTTPS_EXPOSE=8037:80
|
||||
healthcheck:
|
||||
interval: 120s
|
||||
timeout: 2s
|
||||
retries: 1
|
||||
depends_on:
|
||||
- db
|
|
@ -349,15 +349,20 @@ class CompatModule implements ModuleInterface {
|
|||
* @return void
|
||||
*/
|
||||
protected function fix_page_builders(): void {
|
||||
if ( $this->is_elementor_pro_active() || $this->is_divi_theme_active() ) {
|
||||
add_filter(
|
||||
'woocommerce_paypal_payments_single_product_renderer_hook',
|
||||
function(): string {
|
||||
return 'woocommerce_after_add_to_cart_form';
|
||||
},
|
||||
5
|
||||
);
|
||||
}
|
||||
add_action(
|
||||
'init',
|
||||
function() {
|
||||
if ( $this->is_elementor_pro_active() || $this->is_divi_theme_active() ) {
|
||||
add_filter(
|
||||
'woocommerce_paypal_payments_single_product_renderer_hook',
|
||||
function(): string {
|
||||
return 'woocommerce_after_add_to_cart_form';
|
||||
},
|
||||
5
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue