macromedia flash actionscript scripting, php, remoting, webservices, c#, javascript
If we are developing web-applications or web-sites, we often need to open the files we are editing within our localhost-webserver. In this article i am trying to explain how we could extend our favourite editor, in my case the scite-editor, to give us a handy shortcut(F7-key) for doing this. I think you could transfer this solution easily to your favourite editor.
So, what is the challenge? If we edit a php-file or any other file that belongs to a webserver, we edit it on the physical-file-path of our system. This file-path totally differ from the virtual path that the file has on our webserver. Because of that it is not possible to launch the file directly. We need to translate the physical-file-path to the virtual-file-path first.
I have choosen, once again, vb-script for doing this task. But the task is so easy that it should be no problem to translate the script into any other scripting language. So first take a look to the script:
The script does the following. Get the three arguments: physical-path of the file which is edited, physical-path to document-root and virtual-web-path to document-root. Then the directory-seperator-chars are converted from windows-system-style(backslash) to web-style(slash). Then the physical-path to document root of the edited-file is replaced with the virtual-path to document root. This was the translation, now we could launch the file with the default application, in my case this is the mozilla-browser and it works fine, don't know if other browser work the same. Ready with the script.
The launch-configuration within the scite-properties-files would look something like that, if the vbs-file stays direct within the scite installation-directory.
command.build.$(file.patterns.php)="$(SciteDefaultHome)\open-with-localhost.vbs" "$(FileDir)\$(FileNameExt)" http://localhost D:\xampp\htdocs
command.build.subsystem.$(file.patterns.php)=2
(Attention this are only two lines, starting with command)
As you can see, "http://localhost" is my virtual-web-path and "D:\xampp\htdocs" is my physical-web-path.
Posted by hOk at July 11, 2004 01:20 PM
Comments (0)
|
You can use <code>code that should be highlightned</code> to highlight code! Optionally you can use the attribut language="php|perl|java" within the code tag, otherwise actionscript-highlightning will be used. |
