PHP Classes

File: system/core/load.php

Recommend this page to a friend!
  Classes of Mihajlo Siljanoski  >  Xmodule  >  system/core/load.php  >  Download  
File: system/core/load.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Xmodule
Modular Web application development framework
Author: By
Last change:
Date: 7 years ago
Size: 919 bytes
 

Contents

Class file image Download
<?php

function &load_database($params = '', $active_record_override = false) {
   
$database = & DB($params, $active_record_override);
    return
$database;
}

function
load_configuration($conf = false) {
    if (!
$conf) {
        exit(
'no configuration loaded');
    }
    global
$config;

   
$config = $config[$conf];

    if (
$config['database']['load']) {
       
$GLOBALS['db'] = & load_database($config['database']['driver'] . "://" . $config['database']['username'] . ":" . $config['database']['password'] . "@" . $config['database']['hostname'] . "/" . $config['database']['database'], true);
    }
   
$url=module('url');
    if (!@
$url->segment(1)) {
        require_once
APPPATH . '/pages/' . $config['page'] . '.php';
    } else {
        if (!@include_once(
APPPATH . '/pages/' . @$url->segment(1) . '.php')) {
            require_once
APPPATH . '/pages/' . $config['page404'] . '.php';
        }
    }
}

For more information send a message to info at phpclasses dot org.