Exemplo n.º 1
0
 public function determineViewId()
 {
     $sql = "SELECT viewid FROM viewurl WHERE url = :url";
     $stmt = Db::getInstance()->prepare($sql);
     $stmt->bindValue('url', $this->normalizeHost(App::getHost()));
     $stmt->execute();
     $rs = $stmt->fetch();
     if ($rs) {
         return $rs['viewid'];
     }
     return $this->_viewid;
 }
Exemplo n.º 2
0
 private function _parseParams($app)
 {
     $app->request->method = App::getAction();
     $app->request->requestId = $app->requestId;
     $arr = array_merge($_GET, $_POST);
     $app->request->inputs = $arr;
     if (get_magic_quotes_gpc()) {
         $_COOKIE = array_map('stripslashes', $_COOKIE);
     }
     $app->request->cookies = $_COOKIE;
     $app->request->userip = App::getClientIp();
     if (isset($_SERVER['REMOTE_ADDR'])) {
         $app->request->clientip = $_SERVER['REMOTE_ADDR'];
     } else {
         $app->request->clientip = '127.0.0.1';
     }
     $app->request->url = App::getPath();
     $app->request->url = strtolower($app->request->url);
     $app->request_uri = App::getRequestURI();
     $app->request->host = strtolower(App::getHost());
     $app->request->serverEnvs = $_SERVER;
 }
Exemplo n.º 3
0
                include_once ROOTPATH . strtolower($path);
                return;
            } else {
                if (is_file(ROOTPATH . $path)) {
                    include_once ROOTPATH . $path;
                    return;
                }
            }
        }
    }
}
spl_autoload_register('autoLoader');
global $registry;
App::setUrl();
DEFINE('DESIGNPATH', App::getURLForDesignDirectory());
DEFINE('URL', App::getHost(1) . '/' . LOCAL_CATALOG);
$registry = new registry();
if (!@(include_once ROOTPATH . 'config' . DS . 'settings.php')) {
    include ROOTPATH . 'includes' . DS . 'install.php';
    die;
}
$registry->router = new Router($registry);
try {
    $registry->db = Db::getInstance($Config['database']);
} catch (Exception $e) {
    echo $e->getMessage();
    die;
}
$registry->session = new session($registry);
$registry->loader = new Loader($registry);
$registry->core = new Core($registry);