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

Resolve the vendor/wordpress-autoload.php file on Windows, add PHP 8.1-8.2 support #29

Merged
merged 9 commits into from
Dec 6, 2023

Conversation

srtfisher
Copy link
Member

@srtfisher srtfisher commented Dec 6, 2023

Changed

  • Dropped PHP 7.4 support, adding PHP 8.2 and 3 support explicitly with testing.
  • Added testing against Windows.

Fixed

  • Fixed issue with wordpress-autoload.php file not properly loading on Windows.

Fixes #28

@srtfisher srtfisher marked this pull request as draft December 6, 2023 16:52
@srtfisher srtfisher changed the title Testing for missing file Resolve the vendor/wordpress-autoload.php file on Windows, add PHP 8.1-8.2 support Dec 6, 2023
@srtfisher srtfisher marked this pull request as ready for review December 6, 2023 17:18
Copy link
Member

@kevinfodness kevinfodness left a comment

Choose a reason for hiding this comment

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

A few questions, no blockers - thanks for the quick fix! 🍣


jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [7.4, 8.0, 8.1]
os: [ubuntu-latest, windows-2019]
Copy link
Member

Choose a reason for hiding this comment

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

😮

on:
push:
branches:
- main
Copy link
Member

Choose a reason for hiding this comment

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

This will also trigger after the PR is merged. Is that intentional?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I prefer to always have a status check on the main branch to get a valid status badge.

preg_replace('#/vendor/.*$#', '/vendor/wordpress-autoload.php', __DIR__),
preg_replace('/\\\vendor\\\.*$/', '/vendor/wordpress-autoload.php', __DIR__),
Copy link
Member

Choose a reason for hiding this comment

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

This looks like one too many backslashes - shouldn't it be like this?

Suggested change
preg_replace('/\\\vendor\\\.*$/', '/vendor/wordpress-autoload.php', __DIR__),
preg_replace('/\\vendor\\.*$/', '/vendor/wordpress-autoload.php', __DIR__),

Copy link
Member Author

@srtfisher srtfisher Dec 6, 2023

Choose a reason for hiding this comment

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

I'm not a regex pro to know but in testing with C:\Users\Sean Fisher\Local Sites\wordpress\app\public\wp-content\vendor\alleyinteractive\composer-wordpress-autoloader\src as the __DIR__:

four slashes: preg_replace('/\\\vendor\\\.*$/', '/vendor/wordpress-autoload.php', __DIR__), -> "C:\Users\Sean Fisher\Local Sites\wordpress\app\public\wp-content/vendor/wordpress-autoload.php

two slashes: preg_replace('/\\vendor\\\.*$/', '/vendor/wordpress-autoload.php', __DIR__), -> C:\Users\Sean Fisher\Local Sites\wordpress\app\public\wp-content\vendor\alleyinteractive\composer-wordpress-autoloader\src

https://onlinephp.io?s=lc8_C8IwEAXw2UK_QwYhKtbu_sFBcHIrbgdyJocGYnNc0ha_vRHRRRfXx-P3eOstX7ksxtaJ2ii9W8IxkkRoCFu1d_FKAodg0KvGJYowBLEsFCMgM3B39s7AwJUJbaI2QU-tDQLoPd1djgRNcj2BCTcOWa4-QIVdCj6gzQtRjF6VRVn0KCfb3XhSFqPcupyE2KOhia4B3jjAYjau9Vzp-pXU3-gi38qN56_p_Bf2tv6mpqsH&v=8.2.13

/shrug

@srtfisher srtfisher merged commit 30acf9e into main Dec 6, 2023
17 checks passed
@srtfisher srtfisher deleted the hotfix/missing-file branch December 6, 2023 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autoloader infrequently not included leading to class not found
2 participants