Responsive Site Designer Tips and...

First thought: make a folder <myPHP> and import the folder - but oop's - RSD rejects that.

Kludge/Fix: rename the php file extensions. to (for example) xyz. Add the folder and then after export, rename the files to php extensions.

Given that my project has 28 and growing PHP script files - for AJAX calls, form processing, etc. the best way to do that is to use a command line call - ren *.php *.xyz for example. But opening a command shell window, navigating to the appropriate folder, then typing in the command - it's a PITA.

So I wondered if RSD would allow me to include a batch file? (*.bat). Yep... it does.

So now I have a flip.bat that makes php into xyz files and a fix.bat that changes the extensions back to php. I drop those two batch files into the folder that I want to add, run flip.bat and then add that folder as a resource. That gets it down to a couple clicks.

First thought: make a folder <myPHP> and import the folder - but oop's - RSD rejects that.

Kludge/Fix: rename the php file extensions. to (for example) xyz. Add the folder and then after export, rename the files to php extensions.

Given that my project has 28 and growing PHP script files - for AJAX calls, form processing, etc. the best way to do that is to use a command line call - ren *.php *.xyz for example. But opening a command shell window, navigating to the appropriate folder, then typing in the command - it's a PITA.

So I wondered if RSD would allow me to include a batch file? (*.bat). Yep... it does.

So now I have a flip.bat that makes php into xyz files and a fix.bat that changes the extensions back to php. I drop those two batch files into the folder that I want to add, run flip.bat and then add that folder as a resource. That gets it down to a couple clicks.

Well gllincoin this looks like you have done some great investigative work and found a solution to a problem long outstanding. Well done. Now how about explaining it in as simple English as you can for us rusty old coders and non techi folk so we can give it a try
Wayan in sunny bali

First thought: make a folder <myPHP> and import the folder - but oop's - RSD rejects that.

Kludge/Fix: rename the php file extensions. to (for example) xyz. Add the folder and then after export, rename the files to php extensions.

Given that my project has 28 and growing PHP script files - for AJAX calls, form processing, etc. the best way to do that is to use a command line call - ren *.php *.xyz for example. But opening a command shell window, navigating to the appropriate folder, then typing in the command - it's a PITA.

So I wondered if RSD would allow me to include a batch file? (*.bat). Yep... it does.

So now I have a flip.bat that makes php into xyz files and a fix.bat that changes the extensions back to php. I drop those two batch files into the folder that I want to add, run flip.bat and then add that folder as a resource. That gets it down to a couple clicks.

Well gllincoin this looks like you have done some great investigative work and found a solution to a problem long outstanding. Well done. Now how about explaining it in as simple English as you can for us rusty old coders and non techi folk so we can give it a try
Wayan in sunny bali

Batch jobs are a technique from the 1980's, Wayan, you should know what gllincoln means

Well gllincoin this looks like you have done some great investigative work and found a solution to a problem long outstanding. Well done. Now how about explaining it in as simple English as you can for us rusty old coders and non techi folk so we can give it a try
Wayan in sunny bali

Here is the process to create the batch file to semi-automate the renaming of file extensions. Assumes MS Windows OS. Primary purpose, to allow adding a directory/folder containing *.php files as a resource folder in RSD. In my example, I am substituting .xyz for the .php extension. ren is a batch file shorthand for rename, * is the wildcard that means 'anything'.

Batch files require the file extension .bat and they are command line executable scripts by a long tradition that dates all the way back to the first versions of MS-DOS/IBM-DOS. WIthin the Windows Explorer shell, double-clicking on a file with the .bat extension will 'run' the script in the underlying command line shell.

#2. Open up notepad (or an alternate text editor). Add this line of text:
ren *.php *.xyz

Then select Save As and use the name flip.bat in your <myPHP> directory. NOTE: with notepad you have to change the save as file type from Text Documents (*.txt) to All Files - otherwise Notepad will append the .txt extension to the end of the filename.

Now overwrite the above line of text to:
ren *.xyz *.php

Save this as fix.bat

In Windows Explorer - navigate to your myPHP directory and double-click the flip.bat file. At this point you can add the folder as a resource inside of RSD.

Once you export your website - Open Windows Explorer, navigate to your exported site files, the myPHP directory (or whatever you name it) and double-click fix.bat - now your php files will again have the extension php and you can ftp upload your site including your php code. Remember to use the correct resulting relative path in your custom javascript or form action references.

Well gllincoin this looks like you have done some great investigative work and found a solution to a problem long outstanding. Well done. Now how about explaining it in as simple English as you can for us rusty old coders and non techi folk so we can give it a try
Wayan in sunny bali

Here is the process to create the batch file to semi-automate the renaming of file extensions. Assumes MS Windows OS. Primary purpose, to allow adding a directory/folder containing *.php files as a resource folder in RSD. In my example, I am substituting .xyz for the .php extension. ren is a batch file shorthand for rename, * is the wildcard that means 'anything'.

Batch files require the file extension .bat and they are command line executable scripts by a long tradition that dates all the way back to the first versions of MS-DOS/IBM-DOS. WIthin the Windows Explorer shell, double-clicking on a file with the .bat extension will 'run' the script in the underlying command line shell.

#2. Open up notepad (or an alternate text editor). Add this line of text:
ren *.php *.xyz

Then select Save As and use the name flip.bat in your <myPHP> directory. NOTE: with notepad you have to change the save as file type from Text Documents (*.txt) to All Files - otherwise Notepad will append the .txt extension to the end of the filename.

Now overwrite the above line of text to:
ren *.xyz *.php

Save this as fix.bat

In Windows Explorer - navigate to your myPHP directory and double-click the flip.bat file. At this point you can add the folder as a resource inside of RSD.

Once you export your website - Open Windows Explorer, navigate to your exported site files, the myPHP directory (or whatever you name it) and double-click fix.bat - now your php files will again have the extension php and you can ftp upload your site including your php code. Remember to use the correct resulting relative path in your custom javascript or form action references.

Hope this helps!

Regards,
Gordon

Thanks this is exactly what some users of cc forum will need I am sure
Thanks for sharing

Well gllincoin this looks like you have done some great investigative work and found a solution to a problem long outstanding. Well done. Now how about explaining it in as simple English as you can for us rusty old coders and non techi folk so we can give it a try
Wayan in sunny bali

Here is the process to create the batch file to semi-automate the renaming of file extensions. Assumes MS Windows OS. Primary purpose, to allow adding a directory/folder containing *.php files as a resource folder in RSD. In my example, I am substituting .xyz for the .php extension. ren is a batch file shorthand for rename, * is the wildcard that means 'anything'.

Batch files require the file extension .bat and they are command line executable scripts by a long tradition that dates all the way back to the first versions of MS-DOS/IBM-DOS. WIthin the Windows Explorer shell, double-clicking on a file with the .bat extension will 'run' the script in the underlying command line shell.

#2. Open up notepad (or an alternate text editor). Add this line of text:
ren *.php *.xyz

Then select Save As and use the name flip.bat in your <myPHP> directory. NOTE: with notepad you have to change the save as file type from Text Documents (*.txt) to All Files - otherwise Notepad will append the .txt extension to the end of the filename.

Now overwrite the above line of text to:
ren *.xyz *.php

Save this as fix.bat

In Windows Explorer - navigate to your myPHP directory and double-click the flip.bat file. At this point you can add the folder as a resource inside of RSD.

Once you export your website - Open Windows Explorer, navigate to your exported site files, the myPHP directory (or whatever you name it) and double-click fix.bat - now your php files will again have the extension php and you can ftp upload your site including your php code. Remember to use the correct resulting relative path in your custom javascript or form action references.