Responsive Site Designer Tips and...

User 515127 Photo


Registered User
112 posts

Source of annoyance: RSD won't allow me to import PHP files as resources.

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.
User 2699991 Photo


Registered User
2,175 posts

gllincoln wrote:
Source of annoyance: RSD won't allow me to import PHP files as resources.

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
The Help You Need: When You Need It The Most
A Small but evergrowing selection of SDv3 Ingredients
https://albarosa.sdv3tutorials.com
User 2093190 Photo


Registered User
70 posts
Online Now

Wayan Jaya wrote:
gllincoln wrote:
Source of annoyance: RSD won't allow me to import PHP files as resources.

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 :lol:
puncto – grafik & marketing
D - 69126 Heidelberg
http://www.puncto.info
User 2699991 Photo


Registered User
2,175 posts

Uwe Schmitt wrote:

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


I cannot remember what I did this morning let alone in the 80's
The Help You Need: When You Need It The Most
A Small but evergrowing selection of SDv3 Ingredients
https://albarosa.sdv3tutorials.com
User 515127 Photo


Registered User
112 posts

Wayan Jaya wrote:

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.

#1. Create a folder, store your *.php files in that folder. (example myPHP)

#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






User 2699991 Photo


Registered User
2,175 posts

gllincoln wrote:
Wayan Jaya wrote:

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.

#1. Create a folder, store your *.php files in that folder. (example myPHP)

#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
The Help You Need: When You Need It The Most
A Small but evergrowing selection of SDv3 Ingredients
https://albarosa.sdv3tutorials.com
User 185561 Photo


Registered User
102 posts

Anyone know yet what CSD3 version 2610 is comprised of?
Once you accomplish the impossible, then you can move on to the hard stuff!
User 244626 Photo


Registered User
699 posts

gllincoln wrote:
Wayan Jaya wrote:

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.

#1. Create a folder, store your *.php files in that folder. (example myPHP)

#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 Gordon - This is Super Useful !
Gone Bootstrapping...

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.