Exemple #1
0
    header('HTTP/1.1 304 Not Modified');
    exit;
}
//
// Either we don't have a value for this cache
// or the hash is out of date
// so get the styesheets,
//
// connect to the database
require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'version.php';
//require(dirname(__FILE__).DIRECTORY_SEPARATOR.'fileloc.php'); //is included in top now
require cms_join_path(dirname(__FILE__), 'lib', 'config.functions.php');
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'misc.functions.php';
require cms_join_path(dirname(__FILE__), 'lib', 'classes', 'class.global.inc.php');
require cms_join_path(dirname(__FILE__), 'lib', 'adodb.functions.php');
$gCms = new CmsObject();
load_adodb();
$db = $gCms->GetDb();
require cms_join_path(dirname(__FILE__), 'lib', 'page.functions.php');
// extract the stylesheet(s)
$sql = "SELECT css_text, css_name FROM " . $config['db_prefix'] . "css WHERE css_id = " . $db->qstr($cssid);
$row = $db->GetRow($sql);
// calculate the new etag
$etag = md5($row['css_text']);
// update the hash cache
$hash[$cssid] = $etag;
csscache_hash_to_csvfile($hashfile, $hash);
// add a comment at the start
$css = "/* Start of CMSMS style sheet '{$row['css_name']}' */\n{$row['css_text']}\n/* End of '{$row['css_name']}' */\n\n";
// set encoding
$encoding = '';
/**
 * Return the global gCms object
 *
 * @since 1.7
 * @return object
 */
function &cmsms()
{
    if (class_exists('CmsObject')) {
        return CmsObject::get_instance();
    }
}
 public static function &get_instance()
 {
     if (!self::$_instance) {
         self::$_instance = new CmsObject();
     }
     return self::$_instance;
 }
 function __construct()
 {
     parent::__construct();
 }
Exemple #5
0
 * construction of various important variables like $gCms.
 *
 * @package CMS
 */
#magic_quotes_runtime is a nuisance...  turn it off before it messes something up
if (version_compare(phpversion(), "5.3.0", "<")) {
    set_magic_quotes_runtime(false);
}
require_once $dirname . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'misc.functions.php';
require_once $dirname . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'module.functions.php';
debug_buffer('', 'Start of include');
# sanitize $_GET
array_walk_recursive($_GET, 'sanitize_get_var');
#Make a new CMS object
require cms_join_path($dirname, 'lib', 'classes', 'class.global.inc.php');
$gCms = new CmsObject();
if (isset($starttime)) {
    $gCms->variables['starttime'] = $starttime;
}
#Load the config file (or defaults if it doesn't exist)
require cms_join_path($dirname, 'version.php');
require cms_join_path($dirname, 'lib', 'config.functions.php');
#Grab the current configuration
$config =& $gCms->GetConfig();
#Adjust the url stuff if we're using HTTPS
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {
    // adjust the root url
    if (!isset($config['ssl_url'])) {
        $config['ssl_url'] = str_replace('http://', 'https://', $config['root_url']);
    }
    $config['root_url'] = $config['ssl_url'];