예제 #1
0
파일: index.php 프로젝트: basdog22/Qool
 //get the folder if needed
 amiInAfolder($dirs);
 //if the user is not logged in we just set some typical rights
 givemeGuestRights();
 //set the include path
 //now read configuration
 require_once "Zend/Config/Xml.php";
 $config = new Zend_Config_Xml('config/config.xml');
 //just a simple definition to make things readable
 define('DIR_SEP', $config->host->separator);
 define('APPL_PATH', $config->host->absolute_path);
 $_SESSION['SITE_URL'] = $config->host->http . $config->host->subdomain . $config->host->domain . $config->host->folder;
 //read the database table names and prefix
 $database = new Zend_Config_Xml('config' . DIR_SEP . 'database.xml');
 $database = $database->toArray();
 $database = normalizeDbTables($database);
 //read the routes
 $routes = new Zend_Config_Xml('config' . DIR_SEP . 'routes.xml');
 //read the application addons
 $addons = new Zend_Config_Xml('config' . DIR_SEP . 'addons.xml', 'applications');
 $modules = new Zend_Config_Xml('config' . DIR_SEP . 'addons.xml', 'modules');
 $widgets = new Zend_Config_Xml('config' . DIR_SEP . 'addons.xml', 'widgets');
 //register autoloading
 require_once $dirs['structure']['lib'] . DIR_SEP . "Zend" . DIR_SEP . "Loader" . DIR_SEP . "Autoloader.php";
 $loader = Zend_Loader_Autoloader::getInstance();
 //register Qool
 $loader->registerNamespace('Qool_');
 //register the Templates
 $loader->registerNamespace('Templates_');
 //get the controller object
 $frontend = Zend_Controller_Front::getInstance();
예제 #2
0
파일: install.php 프로젝트: basdog22/Qool
 function addData()
 {
     $xml = readLangFile('config/database.xml');
     $xml = json_encode($xml);
     $xml = json_decode($xml, 1);
     $xml = normalizeDbTables($xml);
     $db = $this->db;
     $query = "REPLACE INTO `{$xml['user_groups']}` (`id`, `title`, `level`) VALUES\r\n\t\t('1', 'Root', 1),\r\n\t\t('2', 'Admin', 2),\r\n\t\t('3', 'Editor', 500),\r\n\t\t('4', 'Member', 6000),\r\n\t\t('5', 'Visitor', 8000)";
     $smt = $db->query($query);
 }