-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
fix stubGenerator #23762
fix stubGenerator #23762
Conversation
You renamed it to |
yes ,fixed thanks |
Its not that easy :( Changing filename case on a windows system on upgrade is a PIA We've had this before although right now I forget exactly what the file was - perhaps @mbabker remembers |
Brian is right. |
Which means deprecating yet another class and renaming it something else when talking about any file that contains a PHP class following an autoloading convention. |
IIRC that was when the JClassLoader file was at the root of the |
Yep exactly. Not a nice way, but the easiest one. |
We could fix the deletion process at https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_admin/script.php#L2257-L2263 if we use realpath to get the real filename we also get the correct case something like this (just a idea) if (JFile::exists(JPATH_ROOT . $file) && realpath(JPATH_ROOT . $file) === JPATH_ROOT . $file && !JFile::delete(JPATH_ROOT . $file)) |
...could be |
Maybe I didn't explained it correct but the reason to use realpath is to match the filename with case on disk with the filename we want to delete. if you use this code you gain nothing, you have to compare the result auf realpath with the filestring we want to delete. btw I think JFile::exists can be omitted because JFile::delete does this anyway |
memo: don't write code on train Co-Authored-By: alikon <[email protected]>
no it's me on the train 😄 |
hmm this will not work if your webserver access the site with a symlink... So we need more magic here |
@mbabker do you have a idea? Maybe testing realpath(JPATH) and realpath($PATH) seperated? |
@Orgoth please retest (test comment in #23725 was in february) and mark your test as successfully > https://docs.joomla.org/Testing_Joomla!_patches#Recording_test_results |
I have tested this item ✅ successfully on d6f533e
File was created and looks good so far.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23762. |
I have tested this item ✅ successfully on 8ff8935 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23762. |
@Orgoth can you please post your successful test at the Tracker? We can merge it than since we have 2 successful tests |
It would be great if testers add the operating system to the test node, because this could lead to problems on different Systems. |
I have tested this item ✅ successfully on 8ff8935 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23762. |
A windows test would be awesome. |
I am very sorry, but I only develop under Linux. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23762. |
stubgenerator runs fine no matter the case of that file on windows |
thx @brianteeman did you tested it with already existing files, lower and uppercase before and after upgrade? |
I ran the script before renaming the file and after renaming the file - it ran correctly in both cases |
I have tested this item 🔴 unsuccessfully on a0538dc Additional there will not be 2 files in windows, so the deletion process (if it works) would delete the whole file without replacement. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23762. |
Ok so we have to find another solution, I would suggest an own function for renaming files, before calling the delete function. |
Pull Request for Issue #23725 .
Summary of Changes
renamed file
libraries/src/Filesystem/Support/Stringcontroller.php
tolibraries/src/Filesystem/Support/StringController.php
Testing Instructions
run: php build/stubGenerator.php
Expected result
file written
Actual result
Error: Failed to start application: Class Joomla\CMS\Filesystem\Support\StringController does not exist