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

[4.0] Paths in configuration.php #24139

Closed
AlekVolsk opened this issue Mar 9, 2019 · 13 comments
Closed

[4.0] Paths in configuration.php #24139

AlekVolsk opened this issue Mar 9, 2019 · 13 comments

Comments

@AlekVolsk
Copy link

AlekVolsk commented Mar 9, 2019

Windows server

Multidirectional slashes in the paths in configuration.php

public $log_path = 'C:\\OSPanel\\domains\\j4.local\\administrator/logs';
public $tmp_path = 'C:\\OSPanel\\domains\\j4.local/tmp';

The same goes for global JPATH_* constants.

Either use DIRECTORY_SEPARATOR constant or write / everywhere.

@Septdir
Copy link
Contributor

Septdir commented Mar 9, 2019

OSPanel download link
https://ospanel.io/download/

@HLeithner
Copy link
Member

Php handles this correct so not a problem?

On windows the php api gives us \ as seperator and we add /tmp to this so it's a simple concat. The rest is done by php so no chance requiered.

But if you like to write a PR to rewrite \ to / it will be considered.

I closing this but you can always reopen it

@b2z
Copy link
Member

b2z commented Mar 9, 2019

@HLeithner so you confirm that '/' is a bug? On Windows it should be \\, right?

@brianteeman
Copy link
Contributor

My development system is windows
The paths on this system are written

public $log_path = 'C:\\htdocs\\joomla-cms\\administrator/logs';

Windows happily writes the logs into that directory.

So what is the problem that needs to be solved?

@HLeithner
Copy link
Member

can you give me an example component? that has this problem?

@HLeithner HLeithner reopened this Mar 9, 2019
@brianteeman
Copy link
Contributor

whats the point in having an api if its not going to be used?

@HLeithner
Copy link
Member

HLeithner commented Mar 9, 2019

there could be many reasons why you don't us the Joomla API,
But I can't reproduce it:

$path = 'c:\\temp\\test';
var_dump(is_dir($path));

$path = 'c:\\temp/test';
var_dump(is_dir($path));
C:\temp>c:\php\php test.php
C:\temp\test.php:5:
bool(true)
C:\temp\test.php:9:
bool(true)

@AlekVolsk and why do you delete your comments?

Oh you edit your issue, sry didn't notice this. Please make comments.

@roland-d
Copy link
Contributor

roland-d commented Mar 9, 2019

Long time Windows user. Never had a problem with paths like C:\\OSPanel\\domains\\j4.local\\administrator/logs

@HLeithner
Copy link
Member

The only problem I can think of at the moment is if you try to manipulate the path, f.ex. removing parts of it.

@mbabker
Copy link
Contributor

mbabker commented Mar 9, 2019

General bit of advice, any time a path is going to be shown to a user it's a good idea to run it through JPath::clean() which standardizes the directory separator. So when saving config changes, putting these (and other configurable paths like the cache_path or in 4.0 the session_filesystem_path) through the API wouldn't hurt anything, but it clearly isn't something that's mandatory for PHP to work right.

@Septdir
Copy link
Contributor

Septdir commented Mar 9, 2019

Such paths are not a bug. But you must admit, this is not the correct one.

@ghost ghost added the J4 Issue label Apr 4, 2019
@ghost ghost changed the title [3.9][4.0] Paths in configuration.php [4.0] Paths in configuration.php Apr 19, 2019
@joomla-cms-bot
Copy link

Set to "closed" on behalf of @jwaisner by The JTracker Application at issues.joomla.org/joomla-cms/24139

@jwaisner
Copy link
Member

Closing as it is expected behavior and does not effect operation of the CMS outside of what is expected.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24139.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants