From 1342d248078215d46df7daa3a5d1c666e2eae8aa Mon Sep 17 00:00:00 2001 From: ole1986 Date: Wed, 27 Nov 2024 11:50:58 +0100 Subject: [PATCH] Updated deploy (test) --- .distignore | 2 -- .github/workflows/wordpress-deploy.yml | 10 ++++++++++ composer.json | 5 ++--- wc-recurring.php | 8 ++++---- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.distignore b/.distignore index 74e164b..f0aeea7 100644 --- a/.distignore +++ b/.distignore @@ -3,7 +3,5 @@ assets .git .github -vendor - .distignore .gitignore diff --git a/.github/workflows/wordpress-deploy.yml b/.github/workflows/wordpress-deploy.yml index 5b8d822..f864ef3 100644 --- a/.github/workflows/wordpress-deploy.yml +++ b/.github/workflows/wordpress-deploy.yml @@ -12,6 +12,16 @@ jobs: run: | sudo apt-get update sudo apt-get install subversion + - run: rm composer.lock + - name: Install dependencies + run: composer install --no-interaction --prefer-source + - name: Run strauss + run: composer prefix-namespaces + - name: FIX ROSPDF includes and fonts + run: cp -r vendor/rospdf/pdf-php/src/{include,fonts} vendor_build/rospdf/pdf-php/src/ + - name: Remove vendor + run: rm -r vendor + - run: composer dump-autoload - name: WordPress Plugin Deploy id: deploy uses: 10up/action-wordpress-plugin-deploy@stable diff --git a/composer.json b/composer.json index aa63991..05007b4 100644 --- a/composer.json +++ b/composer.json @@ -12,8 +12,7 @@ ], "scripts": { "prefix-namespaces": [ - "strauss", - "@php composer dump-autoload" + "strauss" ] }, "autoload": { @@ -28,7 +27,7 @@ "classmap_prefix": "", "constant_prefix": "", "packages": [], - "update_call_sites": false, + "update_call_sites": true, "override_autoload": {}, "exclude_from_copy": { "packages": [], diff --git a/wc-recurring.php b/wc-recurring.php index 61a209b..2983c12 100644 --- a/wc-recurring.php +++ b/wc-recurring.php @@ -19,10 +19,10 @@ define('WCRECURRING_PLUGIN_DIR', plugin_dir_path(__FILE__)); define('WCRECURRING_PLUGIN_URL', plugin_dir_url(__FILE__)); -if (file_exists('vendor_build/autoload.php')) { - require_once 'vendor_build/autoload.php'; -} else { - require_once 'vendor/autoload.php'; +require_once 'vendor/autoload.php'; + +if (file_exists(WCRECURRING_PLUGIN_DIR. '/vendor_build/autoload.php')) { + require_once WCRECURRING_PLUGIN_DIR .'/vendor_build/autoload.php'; } add_action('init', ['\WcRecurring\WcRecurringIndex', 'init']);