<?php

/**
 * Copyright (C) LJCMS All rights reserved.
 * <E-Mail：aspcms@qq.com>
 * Url http://www.liangjing.org
 *     http://www.8CMS.com
 * Update 2016.03.19
 */
require_once('run.conf.php');
if(!defined('LJCMS')) {
	header("Location:install/index.php");
}
@session_start();
require_once(BASE_ROOT.'source/core/ljphp.php');

$lang=$_SESSION['lang'];
X::__run();

if($lang!=''){
    X::language($lang);
}
function M($name, $type) {
    return X::model($name, $type);
}
function G($name, $type="string") {
    $_get_value = XRequest::getArgs($name);
    if ($type == "int") {
        $_get_value = intval($_get_value);
    }
    elseif ($type == "float") {
        $_get_value = floatval($_get_value);
    }
    elseif ($type == "double") {
        $_get_value = doubleval($_get_value);
    }
    elseif ($type == "floor") { 
        $_get_value = floor($_get_value);
    }
    return $_get_value;
}
function GPC($array_name) {
    $_get_args = array();
    if (is_array($array_name)) {
        foreach ($array_name as $k=>$v) {
            if (is_numeric($k)) {
                $k = $v;
            }
            $_value = G($k, $v);
            $_get_args[$k] = $_value;
        }
    }
    return $_get_args;
}

$util_packs = array('handle', 'request', 'valid', 'filter', 'page', 'file');
foreach($util_packs as $key=>$value){
	X::loadUtil($value);
}

$lib_packs = array('hook', 'url', 'seo');
foreach($lib_packs as $key=>$value) {
    X::loadLib($value);
}
?>
