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

Use DIRECTORY_SEPARATOR instead of slash in filepaths #73

Merged
merged 2 commits into from
Oct 21, 2021

Conversation

mnelson4
Copy link
Contributor

@mnelson4 mnelson4 commented Aug 25, 2021

Description of the Change

Use the PHP constant [DIRECTORY_SEPARATOR](https://www.php.net/manual/en/dir.constants.php) (which is / on *nix, and \ on windows) instead of / in filepaths.
Without this, the plugin doesn't work on Windows machines: EDW thinks the modules aren't defined and so doesn't try to activate them, so the "Print" admin page doesn't appear. See https://i.imgur.com/9n1CqO0.png

Alternate Designs

You could alternatively do a string replace to standardize which slashes are used. This seemed simpler.

Benefits

EDW can now work on Windows machines, including localhost installs.

Possible Drawbacks

Verification Process

I tested this on Windows (see https://i.imgur.com/ANd5ut7.png) and on a Linux machine.
I'm able to create a print edition zip.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation. --> I don't think it does
  • I have updated the documentation accordingly. --> N/A
  • I have added tests to cover my change. -->I have not added tests, I don't think this is necessary
  • All new and existing tests passed. --> you talking crazy talk; what tests?

Applicable Issues

Should address #73

@jeffpaul jeffpaul linked an issue Aug 25, 2021 that may be closed by this pull request
@jeffpaul jeffpaul added this to the 1.2.0 milestone Aug 25, 2021
Copy link
Collaborator

@dinhtungdu dinhtungdu left a comment

Choose a reason for hiding this comment

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

I can't test on Windows but the code looks good to me!

@jeffpaul jeffpaul merged commit 0fe5041 into 10up:develop Oct 21, 2021
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.

There isn't Print section in admin console
3 participants