Habari\Site::script_name PHP Method

script_name() public static method

script_name is a helper function to determine the name of the script not all PHP installations return the same values for $_SERVER['SCRIPT_URL'] and $_SERVER['SCRIPT_NAME']
public static script_name ( )
    public static function script_name()
    {
        switch (true) {
            case isset(self::$scriptname):
                break;
            case isset($_SERVER['SCRIPT_NAME']):
                self::$scriptname = $_SERVER['SCRIPT_NAME'];
                break;
            case isset($_SERVER['PHP_SELF']):
                self::$scriptname = $_SERVER['PHP_SELF'];
                break;
            default:
                Error::raise(_t('Could not determine script name.'));
                die;
        }
        return self::$scriptname;
    }