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

feat: Improve for windows #9318

Draft
wants to merge 2 commits into
base: 4.6
Choose a base branch
from

Conversation

neznaika0
Copy link
Contributor

Description
See https://forum.codeigniter.com/showthread.php?tid=92138

An attempt to adapt to the Windows system. This PR is not for merging, it is for viewing. I ask you to speak about the method. File ./errors.txt the errors that remained in my system. For those who do not have windows.

Maybe I want too much, but we don't have enough discussion to resolve such issues.
Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@neznaika0
Copy link
Contributor Author

@datamweb We are waiting for an opinion

@@ -0,0 +1,202 @@
15) CodeIgniter\Files\FileCollectionTest::testResolveDirectorySymlink
ErrorException: symlink(): Permission denied
Copy link
Contributor

Choose a reason for hiding this comment

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

To bypass the issue related to Permission denied rights, you can run your terminal with "Run as Administrator" privileges.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know about it.

Copy link
Member

@paulbalandan paulbalandan Dec 13, 2024

Choose a reason for hiding this comment

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

You can skip the test when in windows by adding a @requires OS Linux phpdoc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is undesirable to skip it. More useful to show a notification of admin rights.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, but how for Github actions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are no actions under windows right now. The tests are completed. You can check is_windows() and show a warning. Or describe this case in the documentation

E:\www\CodeIgniterProjects\dev\tests\system\Helpers\FilesystemHelperTest.php:525

20) CodeIgniter\Publisher\PublisherInputTest::testAddUri
CodeIgniter\HTTP\Exceptions\HTTPException: 60 : SSL certificate problem: unable to get local issuer certificate
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that this issue is related to an incorrect configuration on your system. I do not have this problem. Please try to resolve it by referring to the link below:

https://stackoverflow.com/questions/35638497/curl-error-60-ssl-certificate-prblm-unable-to-get-local-issuer-certificate

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. I used to disable validation in other scripts. I didn't get an error. If the PR is approved, it will be described in the documentation

@neznaika0
Copy link
Contributor Author

It is important to consider the fix globally. Is it good to use the new functions?

<!-- Directory containing the front controller (index.php) -->
<const name="PUBLICPATH" value="./public/"/>
</php>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Copy link
Member

Choose a reason for hiding this comment

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

what changed here? line indents?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Enable showing deprecations in console - autoreformat file.

/**
* A real path with identical slashes in Unix/Windows
*/
function _realpath(string $path): bool|string
Copy link
Member

Choose a reason for hiding this comment

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

I would put this inside your normalize_path function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe. But they are created in different areas. The problem now is duplicates - they are needed in the earliest call. normalize_path() is available later

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, these are slightly different functions. normalize_path() can take a nonexistent or relative path. Why add realpath() to it?

@neznaika0 neznaika0 force-pushed the improve-for-windows branch 4 times, most recently from 6c9f82e to fe72702 Compare December 14, 2024 10:04
Signed-off-by: neznaika0 <[email protected]>
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.

3 participants