rick645 Posted July 20, 2023 Share Posted July 20, 2023 (edited) If I normalically open a php file without extension, not highlighted the syntax, autocomplete is not activated, etc. If instead I try to open it with PHP Editor https://pasteboard.co/Tak4RjzSpn7V.png this appears to me https://pasteboard.co/n57YsohIxuqy.png Why? Edited July 20, 2023 by rick645 Quote Link to comment https://forums.phpfreaks.com/topic/317105-eclipse-open-php-file-without-extension/ Share on other sites More sharing options...
requinix Posted July 20, 2023 Share Posted July 20, 2023 Without a file extension, your system has to guess what type of file it is based on the data. Apparently, it guessed "map-path". And your PHP Editor doesn't know what to do with "map-path" files. Give your PHP files the .php extension. It's what you're supposed to do. Quote Link to comment https://forums.phpfreaks.com/topic/317105-eclipse-open-php-file-without-extension/#findComment-1610638 Share on other sites More sharing options...
rick645 Posted July 20, 2023 Author Share Posted July 20, 2023 however, the end user should not be asked to specify the extension as well Quote Link to comment https://forums.phpfreaks.com/topic/317105-eclipse-open-php-file-without-extension/#findComment-1610641 Share on other sites More sharing options...
requinix Posted July 20, 2023 Share Posted July 20, 2023 You're saying that you don't believe programmers should be using file extensions? Quote Link to comment https://forums.phpfreaks.com/topic/317105-eclipse-open-php-file-without-extension/#findComment-1610644 Share on other sites More sharing options...
Strider64 Posted July 20, 2023 Share Posted July 20, 2023 3 hours ago, rick645 said: however, the end user should not be asked to specify the extension as well They don't have to if you design and develop the website correct. Quote Link to comment https://forums.phpfreaks.com/topic/317105-eclipse-open-php-file-without-extension/#findComment-1610647 Share on other sites More sharing options...
rick645 Posted July 21, 2023 Author Share Posted July 21, 2023 19 hours ago, requinix said: You're saying that you don't believe programmers should be using file extensions? Programmers yes. End users don't: they should have as simple an interface as possible, which hides unnecessary details. 16 hours ago, Strider64 said: They don't have to if you design and develop the website correct. websiite? Quote Link to comment https://forums.phpfreaks.com/topic/317105-eclipse-open-php-file-without-extension/#findComment-1610650 Share on other sites More sharing options...
requinix Posted July 21, 2023 Share Posted July 21, 2023 Strider is probably on the right subject. URLs don't have to match files. You can have a file named "whatever.php" and show it in a URL as "whatever" - or anything else you want. So keep the file extension, and if you want your URLs to look a certain way then make the URLs look the certain way. Quote Link to comment https://forums.phpfreaks.com/topic/317105-eclipse-open-php-file-without-extension/#findComment-1610651 Share on other sites More sharing options...
gizmola Posted July 21, 2023 Share Posted July 21, 2023 Making a file without an extension work with any sort of serverside language, requires configuration to associate those files with the serverside language. The same sort of association can be made in an editor, but as previously commented, using the rewrite capability in apache mod_rewrite or nginx is the best practice. Quote Link to comment https://forums.phpfreaks.com/topic/317105-eclipse-open-php-file-without-extension/#findComment-1610654 Share on other sites More sharing options...
rick645 Posted July 22, 2023 Author Share Posted July 22, 2023 17 hours ago, requinix said: Strider is probably on the right subject. URLs don't have to match files. You can have a file named "whatever.php" and show it in a URL as "whatever" - or anything else you want. So keep the file extension, and if you want your URLs to look a certain way then make the URLs look the certain way. ... 16 hours ago, gizmola said: Making a file without an extension work with any sort of serverside language, requires configuration to associate those files with the serverside language. The same sort of association can be made in an editor, but as previously commented, using the rewrite capability in apache mod_rewrite or nginx is the best practice. ... You are taking for granted that he is writing a web app. I thought you knew that, with php, can be write both web apps and cli apps Quote Link to comment https://forums.phpfreaks.com/topic/317105-eclipse-open-php-file-without-extension/#findComment-1610669 Share on other sites More sharing options...
requinix Posted July 22, 2023 Share Posted July 22, 2023 1 hour ago, rick645 said: You are taking for granted that he is writing a web app. Taking for granted who is writing a web app? Is it someone other than the person who started this thread? 1 hour ago, rick645 said: I thought you knew that, with php, can be write both web apps and cli apps What? Really? PHP can do other things than serve websites? I had no idea! 🙄 So if this isn't for a website then would you kindly explain what this is all about? Quote Link to comment https://forums.phpfreaks.com/topic/317105-eclipse-open-php-file-without-extension/#findComment-1610671 Share on other sites More sharing options...
rick645 Posted July 22, 2023 Author Share Posted July 22, 2023 tmp.FdTgUEMZjh$ cat rsync-map-path #!/bin/bash rsync -n "$1" "$(./map-path "$1")" tmp.FdTgUEMZjh$ cat map-path #!/usr/bin/php <?php $paths = [ 'bin' => "remote:/bin", 'lib' => "remote:/lib", 'config' => "remote:/etc", 'config2' => "remote:/config", //... ]; echo $paths[$argv[1]]; tmp.FdTgUEMZjh$ ./rsync-map-path lib RSYNC OUTPUT... Quote Link to comment https://forums.phpfreaks.com/topic/317105-eclipse-open-php-file-without-extension/#findComment-1610673 Share on other sites More sharing options...
rick645 Posted July 22, 2023 Author Share Posted July 22, 2023 35 minutes ago, rick645 said: tmp.FdTgUEMZjh$ cat rsync-map-path #!/bin/bash rsync -n "$1" "$(./map-path "$1")" tmp.FdTgUEMZjh$ cat map-path #!/usr/bin/php <?php $paths = [ 'bin' => "remote:/bin", 'lib' => "remote:/lib", 'config' => "remote:/etc", 'config2' => "remote:/config", //... ]; echo $paths[$argv[1]]; tmp.FdTgUEMZjh$ ./rsync-map-path lib RSYNC OUTPUT... RSYNC OUTPUT... rsync -n ... it shouldn't produce output, I apologize Quote Link to comment https://forums.phpfreaks.com/topic/317105-eclipse-open-php-file-without-extension/#findComment-1610674 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.