summaryrefslogblamecommitdiffstats
path: root/app/class/framework.class.php
blob: 11902d0f61342c12eba7f8c00f1a0612780d5afe (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12

     



                                                                     





                                                                                      








                                                              



                                                                    
                                                                                   












                                        
<?php

/* Include the Scrott system-level configuration file if it exists */
is_file("scrott.conf.php") &&
    require_once "scrott.conf.php";

/*
 * Global functions / operations and access to contextual or session-based information
 */
abstract class Framework
{
    /*
     * Check for the existence of Scrott's system-level config
     */
    function scrottConfExists()
    {
        global $_SCROTT;
        return isset($_SCROTT['conf']);
    }

    /*
     * Get the absolute path on this server for the root of this app
     */
    function ar()
    {
        return substr($_SERVER['PHP_SELF'], 0, -10); // 10 = length of "/index.php"
    }

    /*
     * Redirect to the given URL and die
     */
    function redirectTo($url)
    {
        http_redirect($url);
        exit;
    }
}

?>