User tests: Successful: Unsuccessful:
Pull Request for Issue #23725 .
renamed file libraries/src/Filesystem/Support/Stringcontroller.php
to libraries/src/Filesystem/Support/StringController.php
run: php build/stubGenerator.php
file written
Error: Failed to start application: Class Joomla\CMS\Filesystem\Support\StringController does not exist
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
yes ,fixed thanks
Brian is right.
Windows is actually fine. It's Linux where you get an issue because they count as different files and you end up with two files.
Now we can add the old file to be deleted into the admin script, which would work on Linux. But it would fail on Windows since it would delete the new file (it ignores case).
So there is no simple solution. You would need a script which checks OS or if the file is there twice and only then delete it.
I think last time we had that issue we just moved the file to another location, then it's simple.
I think last time we had that issue we just moved the file to another location, then it's simple.
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.
We've had this before although right now I forget exactly what the file was - perhaps @mbabker remembers
IIRC that was when the JClassLoader file was at the root of the libraries
directory with a camel cased filename or something like that and we just shoved it into the libraries/cms
directory following the normal file convention.
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.
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))
Category | Libraries | ⇒ | Administration com_admin Libraries |
...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.
JFile::exists uses is_file and this is case insensitive, the same is true for unlink used by JFile::delete
btw I think JFile::exists can be omitted because JFile::delete does this anyway
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
@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
isley@isley:~/repos/test/joomla$ php build/stubGenerator.php
Stubs file written
File was created and looks good so far.
-rw-rw-r-- 1 isley isley 54439 Apr 24 14:15 stubs.php
Labels |
Removed:
J3 Issue
|
I have tested this item
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
### Details:
System Kubuntu 18.04 LTS
PHP Built On Linux isley.lc 4.15.0-47-generic #50-Ubuntu SMP Wed Mar 13 10:44:52 UTC 2019 x86_64
Database Type mysql
Database Version 8.0.15-5
Database Collation utf8_general_ci
Database Connection Collation utf8mb4_0900_ai_ci
PHP Version 7.1.28-1+ubuntu18.04.1+deb.sury.org+3
Web Server Apache/2.4.39 (Ubuntu)
WebServer to PHP Interface fpm-fcgi
A windows test would be awesome.
I am very sorry, but I only develop under Linux.
Maybe @gwsdesk has the possibility to test under Windows.
I am very sorry, but I only develop under Linux.
Maybe @gwsdesk has the possibility to test under Windows.
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
In windows this PR breaks the whole deletion process, because realpath
converts all slashes to \
, so it's always not true (and the JFile::delete will never be called).
Additional there will not be 2 files in windows, so the deletion process (if it works) would delete the whole file without replacement.
Ok so we have to find another solution, I would suggest an own function for renaming files, before calling the delete function.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-05-01 09:11:51 |
Closed_By | ⇒ | alikon |
You renamed it to?
StringcController.php
. There is ac
to much in there