Welcome Guest, Not a member yet? Register   Sign In
Possible discrepancy in FileLocator between Windows and Linux
#5

I think I see your point, however, maybe we want to avoid this behaviour as it can lead to misinterpretations.
Here ist the result of the view->render() function for both environments:

Windows:
$view: Auth\login
$renderVars['file']: C:\XAMPP\htdocs\ci-ttv\app\Config/../Views/Auth\login.php
is_file: bool(true)

Debian:
$view: Auth\login
$renderVars['file']: /var/www/xxx/html/intern/app/Config/../Views/Auth\login.php
is_file: bool(false) (hence, FileLocator is called)

While I agree that the result of is_file is legit here, as Windows does not really care about mixed separators, I believe we should prohibit loading view this way. I think so because usually, if someone references a view in the form 'Auth\login', he is supposedly trying to address a namespaced view. If one want to adress a view by path, 'Auth/login' should be used. Thats why I think we should check whether a $view name is namespaced in the view render function instead of just relying on the is_file function.

Overall, I think its more an issue of philosophy that we want to project on the user, but as displayed in my case, unexperienced users might run into problems when pushing their systems to live environment.
What do you think?
Reply


Messages In This Thread
RE: Possible discrepancy in FileLocator between Windows and Linux - by aschmitz - 08-17-2020, 05:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB