Scriptcase Entwicklungs- oder Produktivumgebung

Scriptcase Entwicklungs- oder Produktivumgebung

Ermitteln, ob ein Programm auf development oder deployed – Server läuft

Manchmal ist es nötig den Programmablauf zu ändern, je nachdem, ob das Programm in der Entwicklungsumgebung von Scriptcase oder auf einem unabhängigen ‚production‘ Server läuft.

Ein solcher Fall ist z.B. der Zugriff auf hochgeladene Dateien, da sich der absolute und der relative Pfad entsprechend ändert.

Natürlich kann man die IP-Adressen oder die URL abfragen, auf dem das Programm gerade läuft.

Eine elegantere Variante hat Carlos von Scriptcase in einem Webinar gezeigt.

Man fragt in der Session-Variablen von Scriptcase ab, wie der Pfad von aktuellen Umgebung lautet und prüft, ob es sich um die Entwicklungsumgebung von Scriptcase handelt:

 

Check if Scriptcase development server or deployed environment

Check if Scriptcase development server or deployed environment

Check if the software runs on a Scriptcase development environment or deployed server

Sometimes it is necessary to change parameters, depending on the environment the software is running on: Scriptcase Development or a server with the deployed application.

Example: Accessing files which have been uploaded, cause the absolute and the relative path is different.

Obviously the app could check the IP adress or the URL of the server it is running on.

Carlos (Scriptcase) has shown a much more sophisticated way during a Webinar.

He suggested to check the session variables of Scriptcase to check the path of the current environment: