Is there a session variable that always has the currently loaded app?

I have a need to take action in SC events depending on the name of the current app being executed. Does anyone know the variable name that always has this in SC?

you can use a PHP function.
try:

echo (basename($_SERVER[‘PHP_SELF’]));

i use this in every application in onScriptInit

Super. Thanks

Be aware of that: [LIST=1]

  • [B]curent_directory !== app_name[/B]
  • [B]curent_directory === frendly_URL[/B] [/LIST] [B]And of course there is a build in variables contains some project and app info:[/B]
    
    // onScriptInit event
    $self = $_SERVER['PHP_SELF'];
    echo "Project name : " . $this->Ini->nm_grupo .'<br>';
    echo "Project ver. : " . $this->Ini->nm_grupo_versao .'<br>';
    echo "Current app  : " . $this->Ini->nm_cod_apl .'<br>';
    echo '<br>frendly_name V1: '. basename(dirname($self));
    echo "<br>frendly_name V2: ".basename(pathinfo($self, PATHINFO_DIRNAME));
    echo '<br>called_script : '. basename($self);
    echo '<br>curent_file : '. basename(__FILE__);
    
    
  • No need to double post…